public static enum StandardConverters.StringToNumberConverter extends java.lang.Enum<StandardConverters.StringToNumberConverter> implements Converter
Converter that will convert a String to a Number. The
following Number subclasses are supported:
AtomicIntegerAtomicLongBigIntegerByteDoubleFloatIntegerLongShort| Enum Constant and Description |
|---|
INSTANCE
The instance of this converter
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canConvert(java.lang.Class<?> sourceType,
java.lang.Class<?> targetType)
Returns true if objects of sourceType can be converted to targetType.
|
<T> T |
convert(java.lang.Object source,
java.lang.Class<T> targetType)
Convert the source to targetType.
|
static StandardConverters.StringToNumberConverter |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static StandardConverters.StringToNumberConverter[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final StandardConverters.StringToNumberConverter INSTANCE
public static StandardConverters.StringToNumberConverter[] values()
for (StandardConverters.StringToNumberConverter c : StandardConverters.StringToNumberConverter.values()) System.out.println(c);
public static StandardConverters.StringToNumberConverter valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic boolean canConvert(java.lang.Class<?> sourceType,
java.lang.Class<?> targetType)
ConverterConverter.convert(Object, Class) is capable of converting an instance of sourceType to targetType.canConvert in interface ConvertersourceType - the source type to convert when (may be null if source is null)targetType - the target type to convert to (required)public <T> T convert(java.lang.Object source,
java.lang.Class<T> targetType)
Converter