Class Expiration


  • public class Expiration
    extends java.lang.Object
    This class provides values to specify expiration of items in the cache.
    • Constructor Summary

      Constructors 
      Constructor Description
      Expiration()
      Instantiates expiration to provide expiration values for items in the cache.
      Expiration​(ExpirationType expirationType)
      Instantiates expiration to provide expiration values for items in the cache.
      Expiration​(ExpirationType expirationType, TimeSpan expireAfter)
      Instantiates expiration to provide expiration values for items in the cache.
    • Constructor Detail

      • Expiration

        public Expiration()
        Instantiates expiration to provide expiration values for items in the cache.
      • Expiration

        public Expiration​(ExpirationType expirationType)
        Instantiates expiration to provide expiration values for items in the cache.
        Parameters:
        expirationType - Enum indicating type of expiration to be used while expiring items in cache.
      • Expiration

        public Expiration​(ExpirationType expirationType,
                          TimeSpan expireAfter)
        Instantiates expiration to provide expiration values for items in the cache.
        Parameters:
        expirationType - Enum indicating type of expiration to be used while expiring items in cache.
        expireAfter - Value of time in the form of TimeSpan that shows after how much time, the item in cache is to be expired.
    • Method Detail

      • getExpireAfter

        public final TimeSpan getExpireAfter()
        Gets the value of time in the form of TimeSpan that shows after how much time, the item in cache is to be expired.
        Returns:
        The TimeSpan instance that indicates the time after which item will be expired from cache.
      • setExpireAfter

        public final void setExpireAfter​(TimeSpan value)
        Sets the value of time in the form of TimeSpan that shows after how much time, the item in cache is to be expired.
        Parameters:
        value - The TimeSpan instance that indicates the time after which item will be expired from cache.
      • getExpirationType

        public final ExpirationType getExpirationType()
        The type of expiration to be used while expiring items in cache. The value of this type varies from item to item in the cache.
        Returns:
        The expiration type of item in cache.