Class OptionalDoubleStringConverter

java.lang.Object
org.joda.convert.OptionalDoubleStringConverter
All Implemented Interfaces:
FromStringConverter<Object>, StringConverter<Object>, ToStringConverter<Object>, TypedFromStringConverter<Object>, TypedStringConverter<Object>

final class OptionalDoubleStringConverter extends Object implements TypedStringConverter<Object>
Parse the string format of OptionalDouble from Java 8.

This is loaded by reflection only when using Java 8.

  • Field Details

    • TYPE

      private static final Class<?> TYPE
    • EMPTY

      private static final Object EMPTY
    • METHOD_OF

      private static final Method METHOD_OF
    • METHOD_IS_PRESENT

      private static final Method METHOD_IS_PRESENT
    • METHOD_GET

      private static final Method METHOD_GET
  • Constructor Details

    • OptionalDoubleStringConverter

      OptionalDoubleStringConverter()
  • Method Details

    • convertToString

      public String convertToString(Object object)
      Description copied from interface: ToStringConverter
      Converts the specified object to a String.
      Specified by:
      convertToString in interface ToStringConverter<Object>
      Parameters:
      object - the object to convert, not null
      Returns:
      the converted string, may be null but generally not
    • convertFromString

      public Object convertFromString(Class<? extends Object> cls, String str)
      Description copied from interface: FromStringConverter
      Converts the specified object from a String.
      Specified by:
      convertFromString in interface FromStringConverter<Object>
      Parameters:
      cls - the class to convert to, not null
      str - the string to convert, not null
      Returns:
      the converted object, may be null but generally not
    • getEffectiveType

      public Class<?> getEffectiveType()
      Description copied from interface: TypedStringConverter
      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.

      Specified by:
      getEffectiveType in interface TypedFromStringConverter<Object>
      Specified by:
      getEffectiveType in interface TypedStringConverter<Object>
      Returns:
      the effective type