Class ReadableInstantConverter

    • Constructor Detail

      • ReadableInstantConverter

        protected ReadableInstantConverter()
        Restricted constructor.
    • Method Detail

      • getChronology

        public Chronology getChronology​(java.lang.Object object,
                                        DateTimeZone zone)
        Gets the chronology, which is taken from the ReadableInstant. If the chronology on the instant is null, the ISOChronology in the specified time zone is used. If the chronology on the instant is not in the specified zone, it is adapted.
        Specified by:
        getChronology in interface InstantConverter
        Specified by:
        getChronology in interface PartialConverter
        Overrides:
        getChronology in class AbstractConverter
        Parameters:
        object - the ReadableInstant to convert, must not be null
        zone - the specified zone to use, null means default zone
        Returns:
        the chronology, never null
      • getChronology

        public Chronology getChronology​(java.lang.Object object,
                                        Chronology chrono)
        Gets the chronology, which is taken from the ReadableInstant.

        If the passed in chronology is non-null, it is used. Otherwise the chronology from the instant is used.

        Specified by:
        getChronology in interface InstantConverter
        Specified by:
        getChronology in interface PartialConverter
        Overrides:
        getChronology in class AbstractConverter
        Parameters:
        object - the ReadableInstant to convert, must not be null
        chrono - the chronology to use, null means use that from object
        Returns:
        the chronology, never null
      • getInstantMillis

        public long getInstantMillis​(java.lang.Object object,
                                     Chronology chrono)
        Extracts the millis from an object of this converter's type.
        Specified by:
        getInstantMillis in interface InstantConverter
        Overrides:
        getInstantMillis in class AbstractConverter
        Parameters:
        object - the ReadableInstant to convert, must not be null
        chrono - the non-null result of getChronology
        Returns:
        the millisecond value
        Throws:
        java.lang.NullPointerException - if the object is null
        java.lang.ClassCastException - if the object is an invalid type
      • getSupportedType

        public java.lang.Class<?> getSupportedType()
        Returns ReadableInstant.class.
        Specified by:
        getSupportedType in interface Converter
        Returns:
        ReadableInstant.class