T
- the type of the returned valuepublic class FormatConverter<T> extends Object implements PropertyConverter<T>
Format
s.
If the value is a number, the appropriate type conversion is applied.Modifier and Type | Field and Description |
---|---|
private static Integer |
DEFAULT_VALUE
The value to use if the column content is empty.
|
private List<Format> |
formats
All formats to test.
|
Constructor and Description |
---|
FormatConverter(Format... formats)
Creates a new instance of a
FormatConverter . |
Modifier and Type | Method and Description |
---|---|
T |
convert(Class<? extends T> targetType,
String value)
Converts a value from import file to Java.
|
List<Format> |
getFormats()
All formats to test.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
of
private static final Integer DEFAULT_VALUE
private final List<Format> formats
ParseException
is used for conversion.public FormatConverter(Format... formats)
FormatConverter
.formats
- the list of formats to try for conversion, the first that throws no ParseException
is usedpublic T convert(Class<? extends T> targetType, String value)
PropertyConverter
convert
in interface PropertyConverter<T>
targetType
- the type of the target propertyvalue
- the value in the import file@Generated(value="lombok") public List<Format> getFormats()
ParseException
is used for conversion.Copyright © 2022 fastnate.org. All rights reserved.