Class RelativeTime


  • public class RelativeTime
    extends Object
    A time unit relative to now.
    • Constructor Detail

      • RelativeTime

        public RelativeTime​(int value,
                            TimeUnit unit)
    • Method Detail

      • getValue

        public int getValue()
        The time's value.
        Returns:
        time value
      • getUnit

        public String getUnit()
        The unit of time.
        Returns:
        time unit
      • getTimeRelativeTo

        public long getTimeRelativeTo​(long time)
        Returns the time in milliseconds relative to the specified time. For example, if this object is set to 3 days, this method returns 3 days from time.
        Parameters:
        time - time to calculate the relative time.
        Returns:
        time in milliseconds relative to the specified time
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object