Class CacheExpiry

  • All Implemented Interfaces:

    
    public class CacheExpiry
    
                        

    Represents the expiry of a cached item.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final Date expiration
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Date getExpiration()
      static CacheExpiry after(long durationInMillis) Creates a CacheExpiry with CacheExpiry.expiration after durationInMillis from now.
      static CacheExpiry at(Date date) Creates a CacheExpiry with expiration at the date provided.
      static CacheExpiry never() Creates a CacheExpiry with no expiration date.
      boolean isExpired() Evaluates whether the CacheExpiry.expiration has elapsed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • after

         static CacheExpiry after(long durationInMillis)

        Creates a CacheExpiry with CacheExpiry.expiration after durationInMillis from now.

        Parameters:
        durationInMillis - the milliseconds after current time that the expiration should be set to
        Returns:

        CacheExpiry with expiration after durationInMillis from now.

      • at

         static CacheExpiry at(Date date)

        Creates a CacheExpiry with expiration at the date provided.

        Parameters:
        date - that that the CacheExpiry.expiration should be set to
        Returns:

        CacheExpiry with expiration at the date provided.

      • never

         static CacheExpiry never()

        Creates a CacheExpiry with no expiration date.

        Returns:

        CacheExpiry with no expiration.

      • isExpired

         boolean isExpired()

        Evaluates whether the CacheExpiry.expiration has elapsed.

        Returns:

        true if the CacheExpiry.expiration is before current time.