public final class ValueOfBasedConverter<T> extends Object implements Converter<T>
| Modifier and Type | Method and Description |
|---|---|
T |
fromString(String input)
Converts the given input to an object by using the 'valueOf' method.
|
static <T> ValueOfBasedConverter<T> |
getIfEligible(Class<T> clazz)
Checks whether the given class can be used by the
ValueOfBasedConverter (i.e. |
public static final String VALUE_OF
public static <T> ValueOfBasedConverter<T> getIfEligible(Class<T> clazz)
ValueOfBasedConverter (i.e. has a static 'valueOf'
method taking a single String as argument). If so, creates a new instance of converter for this type.clazz - the classValueOfBasedConverter if the given class is eligible,
null otherwise.public T fromString(String input) throws IllegalArgumentException
fromString in interface Converter<T>input - the input, can be nullIllegalArgumentException - if the instance of T cannot be created from the input.Copyright © 2015. All rights reserved.