K - Key type.T - The object cache type.public class CacheEntry<K,T> extends Object implements Comparable<CacheEntry<K,T>>
| Constructor and Description |
|---|
CacheEntry(K key,
T value)
Basic constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(CacheEntry<K,T> o) |
boolean |
equals(Object obj) |
K |
getKey()
Get the cache key.
|
T |
getValue()
Get the value.
|
int |
hashCode() |
boolean |
invalid(long timeout)
Based on timeout, says if an element must be removed from cache.
|
void |
renew()
Renew cache item timestamp.
|
public K getKey()
public T getValue()
public void renew()
public boolean invalid(long timeout)
timeout - The timeout.public int compareTo(CacheEntry<K,T> o)
compareTo in interface Comparable<CacheEntry<K,T>>Copyright © 2016. All rights reserved.