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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InstantDateConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Date
toDatastoreType(Instant inst)
Method to convert the passed member value to the datastore type.Instant
toMemberType(Date date)
Method to convert the passed datastore value to the member type.
-
-
-
Method Detail
-
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 interfaceTypeConverter<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 interfaceTypeConverter<Instant,Date>
- Parameters:
inst
- Value from the member- Returns:
- Value for the datastore
-
-