Class InstantDateConverter

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

public class InstantDateConverter extends Object implements TypeConverter<Instant,Date>
Class to handle the conversion between java.time.Instant and java.util.Date.
See Also:
  • Field Details

  • Constructor Details

    • InstantDateConverter

      public InstantDateConverter()
  • Method Details

    • toMemberType

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

      public Date 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,Date>
      Parameters:
      inst - Value from the member
      Returns:
      Value for the datastore