public static enum StandardConverters.ConstructorParameterConverter extends java.lang.Enum<StandardConverters.ConstructorParameterConverter> implements Converter
Converter that will convert to the target type by creating a new instance
of the target type using the source, or a conversion of the source, as the argument
that's passed to the target type's constructor.
For conversion to be possible the target type must have a constructor that requires a single argument. In the event of the target type having multiple single-argument constructors, the first single-argument constructor that's found will be used.
| 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.ConstructorParameterConverter |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static StandardConverters.ConstructorParameterConverter[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final StandardConverters.ConstructorParameterConverter INSTANCE
public static StandardConverters.ConstructorParameterConverter[] values()
for (StandardConverters.ConstructorParameterConverter c : StandardConverters.ConstructorParameterConverter.values()) System.out.println(c);
public static StandardConverters.ConstructorParameterConverter 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