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
final class DateConverter extends AbstractConverter implements 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
Fields Modifier and Type Field Description (package private) static DateConverter
INSTANCE
Singleton instance.
-
Constructor Summary
Constructors Modifier Constructor Description protected
DateConverter()
Restricted constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getInstantMillis(java.lang.Object object, Chronology chrono)
Gets the millis, which is the Date millis value.java.lang.Class<?>
getSupportedType()
Returns Date.class.-
Methods inherited from class org.joda.time.convert.AbstractConverter
getChronology, getChronology, getPartialValues, getPartialValues, getPeriodType, isReadableInterval, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.joda.time.convert.InstantConverter
getChronology, getChronology
-
Methods inherited from interface org.joda.time.convert.PartialConverter
getChronology, getChronology, getPartialValues, getPartialValues
-
-
-
-
Field Detail
-
INSTANCE
static final DateConverter INSTANCE
Singleton instance.
-
-
Method Detail
-
getInstantMillis
public long getInstantMillis(java.lang.Object object, Chronology chrono)
Gets the millis, which is the Date millis value.- Specified by:
getInstantMillis
in interfaceInstantConverter
- Overrides:
getInstantMillis
in classAbstractConverter
- Parameters:
object
- the Date to convert, must not be nullchrono
- the non-null result of getChronology- Returns:
- the millisecond value
- Throws:
java.lang.NullPointerException
- if the object is nulljava.lang.ClassCastException
- if the object is an invalid type
-
getSupportedType
public java.lang.Class<?> getSupportedType()
Returns Date.class.- Specified by:
getSupportedType
in interfaceConverter
- Returns:
- Date.class
-
-