Class ReadableDurationConverter

    • Constructor Detail

      • ReadableDurationConverter

        protected ReadableDurationConverter()
        Restricted constructor.
    • Method Detail

      • getDurationMillis

        public long getDurationMillis​(java.lang.Object object)
        Extracts the millis from an object of this converter's type.
        Specified by:
        getDurationMillis in interface DurationConverter
        Parameters:
        object - the object to convert, must not be null
        Returns:
        the millisecond value
        Throws:
        java.lang.NullPointerException - if the object is null
        java.lang.ClassCastException - if the object is an invalid type
        java.lang.IllegalArgumentException - if the object is invalid
      • setInto

        public void setInto​(ReadWritablePeriod writablePeriod,
                            java.lang.Object object,
                            Chronology chrono)
        Extracts duration values from an object of this converter's type, and sets them into the given ReadWritableDuration.
        Specified by:
        setInto in interface PeriodConverter
        Parameters:
        writablePeriod - period to get modified
        object - the object to convert, must not be null
        chrono - the chronology to use, must not be null
        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
      • getSupportedType

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