final class CalendarConverter extends AbstractConverter implements InstantConverter, PartialConverter
Modifier and Type | Field and Description |
---|---|
(package private) static CalendarConverter |
INSTANCE
Singleton instance.
|
Modifier | Constructor and Description |
---|---|
protected |
CalendarConverter()
Restricted constructor.
|
Modifier and Type | Method and Description |
---|---|
Chronology |
getChronology(java.lang.Object object,
Chronology chrono)
Gets the chronology.
|
Chronology |
getChronology(java.lang.Object object,
DateTimeZone zone)
Gets the chronology, which is the GJChronology if a GregorianCalendar is used,
BuddhistChronology if a BuddhistCalendar is used or ISOChronology otherwise.
|
long |
getInstantMillis(java.lang.Object object,
Chronology chrono)
Gets the millis, which is the Calendar millis value.
|
java.lang.Class<?> |
getSupportedType()
Returns Calendar.class.
|
getPartialValues, getPartialValues, getPeriodType, isReadableInterval, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPartialValues, getPartialValues
static final CalendarConverter INSTANCE
public Chronology getChronology(java.lang.Object object, Chronology chrono)
If a chronology is specified then it is used. Otherwise, it is the GJChronology if a GregorianCalendar is used, BuddhistChronology if a BuddhistCalendar is used or ISOChronology otherwise. The time zone is extracted from the calendar if possible, default used if not.
getChronology
in interface InstantConverter
getChronology
in interface PartialConverter
getChronology
in class AbstractConverter
object
- the Calendar to convert, must not be nullchrono
- the chronology to use, null means use Calendarjava.lang.NullPointerException
- if the object is nulljava.lang.ClassCastException
- if the object is an invalid typepublic Chronology getChronology(java.lang.Object object, DateTimeZone zone)
getChronology
in interface InstantConverter
getChronology
in interface PartialConverter
getChronology
in class AbstractConverter
object
- the Calendar to convert, must not be nullzone
- the specified zone to use, null means default zonejava.lang.NullPointerException
- if the object is nulljava.lang.ClassCastException
- if the object is an invalid typepublic long getInstantMillis(java.lang.Object object, Chronology chrono)
getInstantMillis
in interface InstantConverter
getInstantMillis
in class AbstractConverter
object
- the Calendar to convert, must not be nullchrono
- the chronology result from getChronology, non-nulljava.lang.NullPointerException
- if the object is nulljava.lang.ClassCastException
- if the object is an invalid typepublic java.lang.Class<?> getSupportedType()
getSupportedType
in interface Converter