public final class Expirations
extends java.lang.Object
Expiry instances.| Modifier and Type | Method and Description |
|---|---|
static Expiry<java.lang.Object,java.lang.Object> |
noExpiration()
Get an
Expiry instance for a non expiring (ie. |
static <K,V> Expiry<K,V> |
timeToIdleExpiration(Duration timeToIdle)
Get a time-to-idle (TTI)
Expiry instance for the given duration |
static <K,V> Expiry<K,V> |
timeToLiveExpiration(Duration timeToLive)
Get a time-to-live (TTL)
Expiry instance for the given duration |
public static Expiry<java.lang.Object,java.lang.Object> noExpiration()
Expiry instance for a non expiring (ie. "eternal") cachepublic static <K,V> Expiry<K,V> timeToLiveExpiration(Duration timeToLive)
Expiry instance for the given durationK - the type of the keys used to access data within the cacheV - the type of the values held within the cachetimeToLive - the duration of TTLpublic static <K,V> Expiry<K,V> timeToIdleExpiration(Duration timeToIdle)
Expiry instance for the given durationK - the type of the keys used to access data within the cacheV - the type of the values held within the cachetimeToIdle - the duration of TTI