Class ExpiryDate


  • public class ExpiryDate
    extends Object
    Instances of this class represent absolute time stamps since 01 Jan 1970 00:00:00 .
    • Method Detail

      • fromRelativeTtl

        public static ExpiryDate fromRelativeTtl​(long relativeTtl)
        Parameters:
        relativeTtl - milliseconds until the ttl expires
        Returns:
        an ExpiryDate with creationTime = current time and value = creationTime + relativeTtl
      • fromAbsolute

        public static ExpiryDate fromAbsolute​(long expiryDate)
        NOTE: relative Ttl can be negative if the ExpiryDate passed in was in the past
        Parameters:
        expiryDate - time measured in milliseconds, between the current time and midnight, January 1, 1970, UTC
        Returns:
        an ExpiryDate object with creationTime = current time, and relativeTtl = ExpiryDate - creationTime;
      • getValue

        public long getValue()
      • getRelativeTtl

        public long getRelativeTtl()
        Returns:
        the original relative ttl used to create this object