ArgumentConverter@API(status=INTERNAL, since="5.0") public class DefaultArgumentConverter extends SimpleArgumentConverter
DefaultArgumentConverter is the default implementation of the
ArgumentConverter API.
The DefaultArgumentConverter is able to convert from strings to a
number of primitive types and their corresponding wrapper types (Byte, Short,
Integer, Long, Float, and Double), date and time types from the
java.time package, and some additional common Java types such as
File, BigDecimal, BigInteger, Currency,
Locale, URI, URL, UUID, etc.
If the source and target types are identical the source object will not be modified.
ArgumentConverter| Modifier and Type | Field | Description |
|---|---|---|
static DefaultArgumentConverter |
INSTANCE |
| Modifier and Type | Method | Description |
|---|---|---|
protected java.lang.Object |
convert(java.lang.Object source,
java.lang.Class<?> targetType) |
Convert the supplied
source object into to the supplied
targetType. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvertpublic static final DefaultArgumentConverter INSTANCE
protected java.lang.Object convert(java.lang.Object source,
java.lang.Class<?> targetType)
SimpleArgumentConvertersource object into to the supplied
targetType.convert in class SimpleArgumentConvertersource - the source object to convert; may be nulltargetType - the target type the source object should be converted
into; never nullnull but only if the target
type is a reference type.