Package org.joda.convert
Class OptionalLongStringConverter
- java.lang.Object
-
- org.joda.convert.AbstractTypeStringConverter
-
- org.joda.convert.OptionalLongStringConverter
-
- All Implemented Interfaces:
FromStringConverter<java.lang.Object>,StringConverter<java.lang.Object>,ToStringConverter<java.lang.Object>,TypedStringConverter<java.lang.Object>
final class OptionalLongStringConverter extends AbstractTypeStringConverter implements TypedStringConverter<java.lang.Object>
Parse the string format of OptionalLong from Java 8.This is loaded by reflection only when using Java 8.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.ObjectEMPTYprivate static java.lang.reflect.MethodMETHOD_GETprivate static java.lang.reflect.MethodMETHOD_IS_PRESENTprivate static java.lang.reflect.MethodMETHOD_OFprivate static java.lang.Class<?>TYPE
-
Constructor Summary
Constructors Constructor Description OptionalLongStringConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectconvertFromString(java.lang.Class<? extends java.lang.Object> cls, java.lang.String str)Converts the specified object from aString.java.lang.StringconvertToString(java.lang.Object object)Converts the specified object to aString.java.lang.Class<?>getEffectiveType()Gets the effective type that the converter works on.-
Methods inherited from class org.joda.convert.AbstractTypeStringConverter
parse
-
-
-
-
Field Detail
-
TYPE
private static final java.lang.Class<?> TYPE
-
EMPTY
private static final java.lang.Object EMPTY
-
METHOD_OF
private static final java.lang.reflect.Method METHOD_OF
-
METHOD_IS_PRESENT
private static final java.lang.reflect.Method METHOD_IS_PRESENT
-
METHOD_GET
private static final java.lang.reflect.Method METHOD_GET
-
-
Method Detail
-
convertToString
public java.lang.String convertToString(java.lang.Object object)
Description copied from interface:ToStringConverterConverts the specified object to aString.- Specified by:
convertToStringin interfaceToStringConverter<java.lang.Object>- Parameters:
object- the object to convert, not null- Returns:
- the converted string, may be null but generally not
-
convertFromString
public java.lang.Object convertFromString(java.lang.Class<? extends java.lang.Object> cls, java.lang.String str)Description copied from interface:FromStringConverterConverts the specified object from aString.- Specified by:
convertFromStringin interfaceFromStringConverter<java.lang.Object>- 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
public java.lang.Class<?> 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 interfaceTypedStringConverter<java.lang.Object>- Returns:
- the effective type
-
-