Package org.joda.convert
Class TypeStringConverterFactory.TypeStringConverter
java.lang.Object
org.joda.convert.TypeStringConverterFactory.TypeStringConverter
- All Implemented Interfaces:
FromStringConverter<Type>,StringConverter<Type>,ToStringConverter<Type>,TypedFromStringConverter<Type>,TypedStringConverter<Type>
- Enclosing class:
TypeStringConverterFactory
static final class TypeStringConverterFactory.TypeStringConverter
extends Object
implements TypedStringConverter<Type>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertFromString(Class<? extends Type> cls, String str) Converts the specified object from aString.convertToString(Type type) Converts the specified object to aString.Class<?> Gets the effective type that the converter works on.
-
Field Details
-
effectiveType
-
-
Constructor Details
-
TypeStringConverter
TypeStringConverter(Class<?> effectiveType)
-
-
Method Details
-
convertToString
Description copied from interface:ToStringConverterConverts the specified object to aString.- Specified by:
convertToStringin interfaceToStringConverter<Type>- Parameters:
type- 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<Type>- 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<Type>- Specified by:
getEffectiveTypein interfaceTypedStringConverter<Type>- Returns:
- the effective type
-