Class CurrencyStringConverter

java.lang.Object
org.datanucleus.store.types.converters.CurrencyStringConverter
All Implemented Interfaces:
Serializable, ColumnLengthDefiningTypeConverter, TypeConverter<Currency,String>

public class CurrencyStringConverter extends Object implements TypeConverter<Currency,String>, ColumnLengthDefiningTypeConverter
Class to handle the conversion between java.util.Currency and a String form.
See Also:
  • Field Details

  • Constructor Details

    • CurrencyStringConverter

      public CurrencyStringConverter()
  • Method Details

    • toMemberType

      public Currency toMemberType(String str)
      Description copied from interface: TypeConverter
      Method to convert the passed datastore value to the member type.
      Specified by:
      toMemberType in interface TypeConverter<Currency,String>
      Parameters:
      str - Value from the datastore
      Returns:
      Value for the member
    • toDatastoreType

      public String toDatastoreType(Currency curr)
      Description copied from interface: TypeConverter
      Method to convert the passed member value to the datastore type.
      Specified by:
      toDatastoreType in interface TypeConverter<Currency,String>
      Parameters:
      curr - Value from the member
      Returns:
      Value for the datastore
    • getDefaultColumnLength

      public int getDefaultColumnLength(int columnPosition)
      Description copied from interface: ColumnLengthDefiningTypeConverter
      Accessor for the default column length to use for the datastore column at the specified position.
      Specified by:
      getDefaultColumnLength in interface ColumnLengthDefiningTypeConverter
      Parameters:
      columnPosition - Position of the column being enquired about (0 = first)
      Returns:
      The column length (-1 if no preference)