Top Description Fields Constructors Methods
org.joda.convert

pack-priv final Class TypedAdapter<T>

extends Object
implements TypedStringConverter<T>
Class Inheritance
All Implemented Interfaces
org.joda.convert.TypedStringConverter, org.joda.convert.TypedFromStringConverter, org.joda.convert.FromStringConverter, org.joda.convert.StringConverter, org.joda.convert.ToStringConverter
Type Parameters
<T>
the type of the converter

Adapts StringConverter to TypedStringConverter.
Since
1.7

Field Summary

Modifier and TypeField and Description
private final StringConverter<T>
private final Class<?>

Constructor Summary

AccessConstructor and Description
private
TypedAdapter(StringConverter<T> conv, Class<?> effectiveType)

Method Summary

Modifier and TypeMethod and Description
pack-priv static <R> TypedStringConverter<R>
adapt(final Class<R> cls, StringConverter<R> converter)

public T
convertFromString(Class<? extends T>
the class to convert to, not null
cls
,
String
the string to convert, not null
str
)

Implements org.joda.convert.FromStringConverter.convertFromString.

Converts the specified object from a String.
public String
convertToString(T
the object to convert, not null
object
)

Implements org.joda.convert.ToStringConverter.convertToString.

Converts the specified object to a String.
public Class<?>
getEffectiveType()

Implements org.joda.convert.TypedStringConverter.getEffectiveType.

Gets the effective type that the converter works on.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

convback to summary
private final StringConverter<T> conv
effectiveTypeback to summary
private final Class<?> effectiveType

Constructor Detail

TypedAdapterback to summary
private TypedAdapter(StringConverter<T> conv, Class<?> effectiveType)

Method Detail

adaptback to summary
pack-priv static <R> TypedStringConverter<R> adapt(final Class<R> cls, StringConverter<R> converter)
convertFromStringback to summary
public T convertFromString(Class<? extends T> cls, String str)

Implements org.joda.convert.FromStringConverter.convertFromString.

Doc from org.joda.convert.FromStringConverter.convertFromString.

Converts the specified object from a String.

Parameters
cls:Class<? extends T>

the class to convert to, not null

str:String

the string to convert, not null

Returns:T

the converted object, may be null but generally not

Annotations
@Override
convertToStringback to summary
public String convertToString(T object)

Implements org.joda.convert.ToStringConverter.convertToString.

Doc from org.joda.convert.ToStringConverter.convertToString.

Converts the specified object to a String.

Parameters
object:T

the object to convert, not null

Returns:String

the converted string, may be null but generally not

Annotations
@Override
getEffectiveTypeback to summary
public Class<?> getEffectiveType()

Implements org.joda.convert.TypedStringConverter.getEffectiveType.

Doc from org.joda.convert.TypedStringConverter.getEffectiveType.

Gets the effective type that the converter works on.

For example, if a class declares the FromString and ToString then 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.

Returns:Class<?>

the effective type

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override