Package org.joda.time.convert
Class DateConverter
java.lang.Object
org.joda.time.convert.AbstractConverter
org.joda.time.convert.DateConverter
- All Implemented Interfaces:
Converter,InstantConverter,PartialConverter
DateConverter converts a java util Date to an instant or partial.
The Date is converted to milliseconds in the ISO chronology.
- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final DateConverterSingleton instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetInstantMillis(Object object, Chronology chrono) Gets the millis, which is the Date millis value.Class<?> Returns Date.class.Methods inherited from class org.joda.time.convert.AbstractConverter
getChronology, getChronology, getPartialValues, getPartialValues, getPeriodType, isReadableInterval, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.joda.time.convert.InstantConverter
getChronology, getChronologyMethods inherited from interface org.joda.time.convert.PartialConverter
getChronology, getChronology, getPartialValues, getPartialValues
-
Field Details
-
INSTANCE
Singleton instance.
-
-
Constructor Details
-
DateConverter
protected DateConverter()Restricted constructor.
-
-
Method Details
-
getInstantMillis
Gets the millis, which is the Date millis value.- Specified by:
getInstantMillisin interfaceInstantConverter- Overrides:
getInstantMillisin classAbstractConverter- Parameters:
object- the Date to convert, must not be nullchrono- the non-null result of getChronology- Returns:
- the millisecond value
- Throws:
NullPointerException- if the object is nullClassCastException- if the object is an invalid type
-
getSupportedType
Returns Date.class.- Specified by:
getSupportedTypein interfaceConverter- Returns:
- Date.class
-