Package org.joda.convert
Class TypedAdapter<T>
java.lang.Object
org.joda.convert.TypedAdapter<T>
- Type Parameters:
T- the type of the converter
- All Implemented Interfaces:
FromStringConverter<T>,StringConverter<T>,ToStringConverter<T>,TypedFromStringConverter<T>,TypedStringConverter<T>
Adapts
StringConverter to TypedStringConverter.- Since:
- 1.7
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTypedAdapter(StringConverter<T> conv, Class<?> effectiveType) -
Method Summary
Modifier and TypeMethodDescription(package private) static <R> TypedStringConverter<R> adapt(Class<R> cls, StringConverter<R> converter) convertFromString(Class<? extends T> cls, String str) Converts the specified object from aString.convertToString(T object) Converts the specified object to aString.Class<?> Gets the effective type that the converter works on.toString()
-
Field Details
-
conv
-
effectiveType
-
-
Constructor Details
-
TypedAdapter
-
-
Method Details
-
adapt
-
convertToString
Description copied from interface:ToStringConverterConverts the specified object to aString.- Specified by:
convertToStringin interfaceToStringConverter<T>- Parameters:
object- the object to convert, not null- Returns:
- the converted string, may be null but generally not
-
convertFromString
Description copied from interface:FromStringConverterConverts the specified object from aString.- Specified by:
convertFromStringin interfaceFromStringConverter<T>- Parameters:
cls- the class to convert to, not nullstr- the string to convert, not null- Returns:
- the converted object, may be null but generally not
-
getEffectiveType
Description copied from interface:TypedStringConverterGets the effective type that the converter works on.For example, if a class declares the
FromStringandToStringthen the effective type of the converter is that class. If a subclass is queried for a converter, then the effective type is that of the superclass.- Specified by:
getEffectiveTypein interfaceTypedFromStringConverter<T>- Specified by:
getEffectiveTypein interfaceTypedStringConverter<T>- Returns:
- the effective type
-
toString
-