Package org.eclipse.hono.cache
Interface ExpiringValueCache<K,V>
-
- Type Parameters:
K
- The type of keys that the cache supports.V
- The type of values that the cache supports.
public interface ExpiringValueCache<K,V>
A cache for values that have a limited validity period.
-
-
Method Detail
-
put
void put(K key, V value, Instant expirationTime)
Puts a value to the cache.Any previous value for the key will be replaced with the new one.
- Parameters:
key
- The key under which the value is stored.value
- The value to store.expirationTime
- The point in time after which the value should be considered invalid.- Throws:
NullPointerException
- if any of the parameters isnull
.IllegalArgumentException
- if the expiration time is not in the future.
-
put
void put(K key, V value, Duration maxAge)
Puts a value to the cache.Any previous value for the key will be replaced with the new one.
- Parameters:
key
- The key under which the value is stored.value
- The value to store.maxAge
- The duration (starting from now) after which the value should be considered invalid.- Throws:
NullPointerException
- if any of the parameters isnull
.IllegalArgumentException
- if the expiration time is not in the future.
-
-