K
- the type of keys maintained by this mapV
- Type of objects stored in cachepublic interface Cacheable<K,V>
Modifier and Type | Interface and Description |
---|---|
static interface |
Cacheable.Entry<V>
A cache entry (key-value pair).
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all of the mappings from this map (optional operation).
|
Set<Map.Entry<K,Cacheable.Entry<V>>> |
entrySet() |
V |
get(K key)
Returns the value to which the specified key is cached,
or
null if this cache contains no mapping for the key. |
Cacheable.Entry<V> |
getEntry(K key)
Returns a
Cacheable.Entry view of the mappings contained in this cache. |
String |
getName()
cache name
|
CachePolicy |
getPolicy()
policy that maintenance the capacity and expire time of data
|
V |
put(K key,
V value)
Associates the specified value with the specified key in this cache
If the cache previously contained a mapping for the key, the old value
is replaced by the specified value.
|
Cacheable.Entry<V> |
remove(K key) |
void |
setPolicy(CachePolicy policy)
Policy to control the cache data
|
long |
size()
Returns the number of key-value mappings in this map.
|
CachePolicy getPolicy()
void setPolicy(CachePolicy policy)
policy
- that maintenance the capacity and expire time of dataV put(K key, V value)
key
- with which the specified value is to be associatedvalue
- to be associated with the specified keyIllegalArgumentException
- if some the key or value are null
.V get(K key)
null
if this cache contains no mapping for the key.key
- the key whose associated value is to be returnednull
if this map contains no mapping for the keyCacheable.Entry<V> getEntry(K key)
Cacheable.Entry
view of the mappings contained in this cache.key
- the key whose associated with entry is to be returnedCacheable.Entry
contained in this cache, or
null
if this map contains no mapping for the keyCacheable.Entry<V> remove(K key)
void clear()
long size()
Copyright © 2012–2020 jkniv, copyleft code. All rights reserved.