Class InstantLongConverter

java.lang.Object
org.datanucleus.store.types.converters.InstantLongConverter
All Implemented Interfaces:
Serializable, TypeConverter<Instant,Long>

public class InstantLongConverter extends Object implements TypeConverter<Instant,Long>
Class to handle the conversion between java.time.Instant and Long (of the epoch millisecs).
See Also:
  • Field Details

  • Constructor Details

    • InstantLongConverter

      public InstantLongConverter()
  • Method Details

    • toMemberType

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

      public Long toDatastoreType(Instant inst)
      Description copied from interface: TypeConverter
      Method to convert the passed member value to the datastore type.
      Specified by:
      toDatastoreType in interface TypeConverter<Instant,Long>
      Parameters:
      inst - Value from the member
      Returns:
      Value for the datastore