public class TTLCache<K,V>
extends java.lang.Object
Constructor and Description |
---|
TTLCache() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
V |
get(K key) |
int |
getSize() |
V |
put(K key,
V value,
long ttl)
Puts an entry into the cache.
|
V |
put(K key,
V value,
long ttl,
long hard_ttl_ms) |
V |
put(K key,
V value,
java.lang.String duration) |
V |
put(K key,
V value,
java.lang.String duration,
long hard_ttl_ms) |
static long |
untilEndOfDay()
Get the number milliseconds until end of the current day.
|
static long |
untilEndOfHour() |
TTLCache |
withSize(int size)
The size of the cache
|
public static long untilEndOfDay()
public static long untilEndOfHour()
public TTLCache withSize(int size)
size
- the new size of the cachepublic V put(K key, V value, long ttl)
key
- the keyvalue
- the valttl
- the ttl in mspublic void clear()
public int getSize()
(c) 2012-2022, OMSLab, Colorado State University.