public final class FromStringBasedConverter<T> extends Object implements Converter<T>
Modifier and Type | Field and Description |
---|---|
static String |
FROM_STRING |
Modifier and Type | Method and Description |
---|---|
T |
fromString(String input)
Converts the given input to an object by using the 'fromString' method.
|
static <T> FromStringBasedConverter<T> |
getIfEligible(Class<T> clazz)
Checks whether the given class can be used by the
FromStringBasedConverter (i.e. |
public static final String FROM_STRING
public static <T> FromStringBasedConverter<T> getIfEligible(Class<T> clazz)
FromStringBasedConverter
(i.e. has a static
'fromString' method taking a single String as argument). If so, creates a new instance of converter for this
type.clazz
- the classFromStringBasedConverter
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 © 2023 Eclipse. All rights reserved.