Class ReadablePartialConverter

    • Constructor Detail

      • ReadablePartialConverter

        protected ReadablePartialConverter()
        Restricted constructor.
    • Method Detail

      • getChronology

        public Chronology getChronology​(java.lang.Object object,
                                        DateTimeZone zone)
        Gets the chronology, which is taken from the ReadablePartial.
        Specified by:
        getChronology in interface PartialConverter
        Overrides:
        getChronology in class AbstractConverter
        Parameters:
        object - the ReadablePartial 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 PartialConverter
        Overrides:
        getChronology in class AbstractConverter
        Parameters:
        object - the ReadablePartial to convert, must not be null
        chrono - the chronology to use, null means use that from object
        Returns:
        the chronology, never null
      • getPartialValues

        public int[] getPartialValues​(ReadablePartial fieldSource,
                                      java.lang.Object object,
                                      Chronology chrono)
        Extracts the values of the partial from an object of this converter's type. The chrono parameter is a hint to the converter, should it require a chronology to aid in conversion.
        Specified by:
        getPartialValues in interface PartialConverter
        Overrides:
        getPartialValues in class AbstractConverter
        Parameters:
        fieldSource - a partial that provides access to the fields. This partial may be incomplete and only getFieldType(int) should be used
        object - the object to convert
        chrono - the chronology to use, which is the non-null result of getChronology()
        Returns:
        the array of field values that match the fieldSource, must be non-null valid
        Throws:
        java.lang.ClassCastException - if the object is invalid
      • getSupportedType

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