Package jodd.typeconverter
Interface TypeConverter<T>
-
- All Known Implementing Classes:
ArrayConverter,BigDecimalConverter,BigIntegerConverter,BooleanArrayConverter,BooleanConverter,ByteArrayConverter,ByteConverter,CalendarConverter,CharacterArrayConverter,CharacterConverter,ClassArrayConverter,ClassConverter,CollectionConverter,DateConverter,DoubleArrayConverter,DoubleConverter,FileConverter,FloatArrayConverter,FloatConverter,IntegerArrayConverter,IntegerConverter,LocalDateConverter,LocalDateTimeConverter,LocaleConverter,LocalTimeConverter,LongArrayConverter,LongConverter,ShortArrayConverter,ShortConverter,SqlDateConverter,SqlTimeConverter,SqlTimestampConverter,StringArrayConverter,StringConverter,TimeZoneConverter,URIConverter,URLConverter,UUIDConverter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface TypeConverter<T>Object converter interface.- See Also:
TypeConverterManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Tconvert(java.lang.Object value)Converts object received as parameter into object of another class.default Tconvert(java.lang.Object value, T defaultValue)Converts object and returns default value if conversion fails.
-
-
-
Method Detail
-
convert
T convert(java.lang.Object value)
Converts object received as parameter into object of another class. For example, anIntegerconverter tries to convert given objects into targetIntegerobject. Converters should try all reasonable ways of conversion into target object, depending on target type.- Parameters:
value- object to convert from- Returns:
- resulting object converted to target type
- Throws:
TypeConversionException- if conversion fails
-
-