Class Duration

    • Field Detail

      • INFINITE

        public static final Duration INFINITE
        Deprecated.
        The infinite Duration.

        This constant should be used to express a lack of a concrete expiration time (ie. "eternal").

      • ZERO

        public static final Duration ZERO
        Deprecated.
        The zero Duration.
    • Constructor Detail

      • Duration

        public Duration​(long length,
                        TimeUnit timeUnit)
        Deprecated.
        Instantiates a new Duration of the given length and TimeUnit.
        Parameters:
        length - the duration length
        timeUnit - the time unit
        Throws:
        NullPointerException - if the given time unit is null
        IllegalArgumentException - if the given length is less than zero
    • Method Detail

      • of

        public static Duration of​(long length,
                                  TimeUnit timeUnit)
        Deprecated.
        Convenience method to create a Duration with the specified values.
        Parameters:
        length - the duration length
        timeUnit - the time unit
        Returns:
        a new Duration
        See Also:
        Duration(long, TimeUnit)
      • getLength

        public long getLength()
        Deprecated.
        Gets the length of time this Duration represents.
        Returns:
        the length of this instance
        Throws:
        IllegalStateException - if this instance is INFINITE
        See Also:
        getTimeUnit()
      • isInfinite

        public boolean isInfinite()
        Deprecated.
        Indicates if this duration represents INFINITE or an infinite Duration.
        Returns:
        true if this instance is the special Forever value
      • hashCode

        public int hashCode()
        Deprecated.
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object obj)
        Deprecated.
        Overrides:
        equals in class Object