Class Expirations

java.lang.Object
org.ehcache.expiry.Expirations

@Deprecated public final class Expirations extends Object
Deprecated.
Utility class for getting predefined Expiry instances.
  • Method Details

    • noExpiration

      @Deprecated public static Expiry<Object,Object> noExpiration()
      Deprecated.
      Use org.ehcache.config.builders.ExpiryPolicyBuilder#noExpiration() instead
      Get an Expiry instance for a non expiring (ie. "eternal") cache.
      Returns:
      the no expiry instance
    • timeToLiveExpiration

      @Deprecated public static Expiry<Object,Object> timeToLiveExpiration(Duration timeToLive)
      Deprecated.
      Use org.ehcache.config.builders.ExpiryPolicyBuilder#timeToLiveExpiration(java.time.Duration) instead
      Get a time-to-live (TTL) Expiry instance for the given Duration.
      Parameters:
      timeToLive - the TTL duration
      Returns:
      a TTL expiry
    • timeToIdleExpiration

      @Deprecated public static Expiry<Object,Object> timeToIdleExpiration(Duration timeToIdle)
      Deprecated.
      Use org.ehcache.config.builders.ExpiryPolicyBuilder#timeToIdleExpiration(java.time.Duration) instead
      Get a time-to-idle (TTI) Expiry instance for the given Duration.
      Parameters:
      timeToIdle - the TTI duration
      Returns:
      a TTI expiry
    • builder

      @Deprecated public static <K, V> Expirations.ExpiryBuilder<K,V> builder()
      Deprecated.
      Use org.ehcache.config.builders.ExpiryPolicyBuilder#expiry() instead
      Fluent API for creating an Expiry instance where you can specify constant values for creation, access and update time. Unspecified values will be set to Duration.INFINITE for create and null for access and update, matching the no expiration expiry.
      Type Parameters:
      K - the key type for the cache
      V - the value type for the cache
      Returns:
      an Expiry builder