class ReadableIntervalConverter extends AbstractConverter implements IntervalConverter, DurationConverter, PeriodConverter
| Modifier and Type | Field and Description |
|---|---|
(package private) static ReadableIntervalConverter |
INSTANCE
Singleton instance.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ReadableIntervalConverter()
Restricted constructor.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getDurationMillis(java.lang.Object object)
Gets the millisecond length of the interval.
|
java.lang.Class<?> |
getSupportedType()
Returns ReadableInterval.class.
|
boolean |
isReadableInterval(java.lang.Object object,
Chronology chrono)
Checks if the input is a ReadableInterval.
|
void |
setInto(ReadWritableInterval writableInterval,
java.lang.Object object,
Chronology chrono)
Extracts interval endpoint values from an object of this converter's
type, and sets them into the given ReadWritableInterval.
|
void |
setInto(ReadWritablePeriod writablePeriod,
java.lang.Object object,
Chronology chrono)
Sets the values of the mutable duration from the specified interval.
|
getChronology, getChronology, getInstantMillis, getPartialValues, getPartialValues, getPeriodType, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetPeriodTypestatic final ReadableIntervalConverter INSTANCE
protected ReadableIntervalConverter()
public long getDurationMillis(java.lang.Object object)
getDurationMillis in interface DurationConverterobject - the intervalpublic void setInto(ReadWritablePeriod writablePeriod, java.lang.Object object, Chronology chrono)
setInto in interface PeriodConverterwritablePeriod - the period to modifyobject - the interval to set fromchrono - the chronology to usepublic boolean isReadableInterval(java.lang.Object object,
Chronology chrono)
If it is, then the calling code should cast and copy the fields directly.
isReadableInterval in interface IntervalConverterisReadableInterval in class AbstractConverterobject - the object to convert, must not be nullchrono - the chronology to use, may be nulljava.lang.ClassCastException - if the object is invalidpublic void setInto(ReadWritableInterval writableInterval, java.lang.Object object, Chronology chrono)
setInto in interface IntervalConverterwritableInterval - interval to get modified, not nullobject - the object to convert, must not be nullchrono - the chronology to use, may be nulljava.lang.ClassCastException - if the object is invalidpublic java.lang.Class<?> getSupportedType()
getSupportedType in interface Converter