Class UnsupportedDurationField

    • Method Detail

      • getInstance

        public static UnsupportedDurationField getInstance​(DurationFieldType type)
        Gets an instance of UnsupportedDurationField for a specific named field. The returned instance is cached.
        Parameters:
        type - the type to obtain
        Returns:
        the instance
      • getName

        public String getName()
        Description copied from class: DurationField
        Get the name of the field.

        By convention, names are plural.

        Specified by:
        getName in class DurationField
        Returns:
        field name
      • isSupported

        public boolean isSupported()
        This field is not supported.
        Specified by:
        isSupported in class DurationField
        Returns:
        false always
      • getValue

        public int getValue​(long duration)
        Always throws UnsupportedOperationException
        Specified by:
        getValue in class DurationField
        Parameters:
        duration - the milliseconds to query, which may be negative
        Returns:
        the value of the field, in the units of the field, which may be negative
        Throws:
        UnsupportedOperationException
      • getValueAsLong

        public long getValueAsLong​(long duration)
        Always throws UnsupportedOperationException
        Specified by:
        getValueAsLong in class DurationField
        Parameters:
        duration - the milliseconds to query, which may be negative
        Returns:
        the value of the field, in the units of the field, which may be negative
        Throws:
        UnsupportedOperationException
      • getValue

        public int getValue​(long duration,
                            long instant)
        Always throws UnsupportedOperationException
        Specified by:
        getValue in class DurationField
        Parameters:
        duration - the milliseconds to query, which may be negative
        instant - the start instant to calculate relative to
        Returns:
        the value of the field, in the units of the field, which may be negative
        Throws:
        UnsupportedOperationException
      • getValueAsLong

        public long getValueAsLong​(long duration,
                                   long instant)
        Always throws UnsupportedOperationException
        Specified by:
        getValueAsLong in class DurationField
        Parameters:
        duration - the milliseconds to query, which may be negative
        instant - the start instant to calculate relative to
        Returns:
        the value of the field, in the units of the field, which may be negative
        Throws:
        UnsupportedOperationException
      • getMillis

        public long getMillis​(int value)
        Always throws UnsupportedOperationException
        Specified by:
        getMillis in class DurationField
        Parameters:
        value - the value of the field, which may be negative
        Returns:
        the milliseconds that the field represents, which may be negative
        Throws:
        UnsupportedOperationException
      • getMillis

        public long getMillis​(long value)
        Always throws UnsupportedOperationException
        Specified by:
        getMillis in class DurationField
        Parameters:
        value - the value of the field, which may be negative
        Returns:
        the milliseconds that the field represents, which may be negative
        Throws:
        UnsupportedOperationException
      • getMillis

        public long getMillis​(int value,
                              long instant)
        Always throws UnsupportedOperationException
        Specified by:
        getMillis in class DurationField
        Parameters:
        value - the value of the field, which may be negative
        instant - the instant to calculate relative to
        Returns:
        the millisecond duration that the field represents, which may be negative
        Throws:
        UnsupportedOperationException
      • getMillis

        public long getMillis​(long value,
                              long instant)
        Always throws UnsupportedOperationException
        Specified by:
        getMillis in class DurationField
        Parameters:
        value - the value of the field, which may be negative
        instant - the instant to calculate relative to
        Returns:
        the millisecond duration that the field represents, which may be negative
        Throws:
        UnsupportedOperationException
      • add

        public long add​(long instant,
                        int value)
        Always throws UnsupportedOperationException
        Specified by:
        add in class DurationField
        Parameters:
        instant - the milliseconds from 1970-01-01T00:00:00Z to add to
        value - the value to add, in the units of the field
        Returns:
        the updated milliseconds
        Throws:
        UnsupportedOperationException
      • add

        public long add​(long instant,
                        long value)
        Always throws UnsupportedOperationException
        Specified by:
        add in class DurationField
        Parameters:
        instant - the milliseconds from 1970-01-01T00:00:00Z to add to
        value - the value to add, in the units of the field
        Returns:
        the updated milliseconds
        Throws:
        UnsupportedOperationException
      • getDifference

        public int getDifference​(long minuendInstant,
                                 long subtrahendInstant)
        Always throws UnsupportedOperationException
        Specified by:
        getDifference in class DurationField
        Parameters:
        minuendInstant - the milliseconds from 1970-01-01T00:00:00Z to subtract from
        subtrahendInstant - the milliseconds from 1970-01-01T00:00:00Z to subtract off the minuend
        Returns:
        the difference in the units of this field
        Throws:
        UnsupportedOperationException
      • getDifferenceAsLong

        public long getDifferenceAsLong​(long minuendInstant,
                                        long subtrahendInstant)
        Always throws UnsupportedOperationException
        Specified by:
        getDifferenceAsLong in class DurationField
        Parameters:
        minuendInstant - the milliseconds from 1970-01-01T00:00:00Z to subtract from
        subtrahendInstant - the milliseconds from 1970-01-01T00:00:00Z to subtract off the minuend
        Returns:
        the difference in the units of this field
        Throws:
        UnsupportedOperationException
      • equals

        public boolean equals​(Object obj)
        Compares this duration field to another.
        Overrides:
        equals in class Object
        Parameters:
        obj - the object to compare to
        Returns:
        true if equal
      • hashCode

        public int hashCode()
        Gets a suitable hashcode.
        Overrides:
        hashCode in class Object
        Returns:
        the hashcode
      • toString

        public String toString()
        Get a suitable debug string.
        Specified by:
        toString in class DurationField
        Returns:
        debug string