class FromBasedConverter<T : Any> : Converter<T>
This 'default' converter tries to create objects using a static 'from' method taking a single String argument. This converter is particularly convenient for builders.
Author
Clement Escoffier
static val FROM: String |
fun fromString(input: String): T
Converts the given input to an object by using the 'from' method. Notice that the method may receive a null value. |
|
static fun <T : Any> getIfEligible(clazz: Class<T>): FromBasedConverter<T>
Checks whether the given class can be used by the FromBasedConverter (i.e. has a static 'from' method taking a single String as argument). If so, creates a new instance of converter for this type. |