Class ReadablePeriodConverter

    • Constructor Detail

      • ReadablePeriodConverter

        protected ReadablePeriodConverter()
        Restricted constructor.
    • Method Detail

      • setInto

        public void setInto​(ReadWritablePeriod duration,
                            java.lang.Object object,
                            Chronology chrono)
        Extracts duration values from an object of this converter's type, and sets them into the given ReadWritablePeriod.
        Specified by:
        setInto in interface PeriodConverter
        Parameters:
        duration - duration to get modified
        object - the object to convert, must not be null
        chrono - the chronology to use
        Throws:
        java.lang.NullPointerException - if the duration or object is null
        java.lang.ClassCastException - if the object is an invalid type
        java.lang.IllegalArgumentException - if the object is invalid
      • getPeriodType

        public PeriodType getPeriodType​(java.lang.Object object)
        Selects a suitable period type for the given object.
        Specified by:
        getPeriodType in interface PeriodConverter
        Overrides:
        getPeriodType in class AbstractConverter
        Parameters:
        object - the object to examine, must not be null
        Returns:
        the period type from the readable duration
        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 ReadablePeriod class.
        Specified by:
        getSupportedType in interface Converter
        Returns:
        ReadablePeriod.class