public interface Cache<K,V>
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(K key)
Returns true if the key (and therefor a corresponding value) is present in the cache or false otherwise.
|
Set<K> |
getKeys()
Returns the set of all keys currently in the cache at the time this method was called.
|
int |
getSize()
Returns the number of key-value pairs in the cache.
|
V |
getValue(K key)
Returns the cached value that is mapped to this key or null if the value is not in the cache.
|
V |
putValueIfAbsent(K key,
V value)
Puts the cached key-value pair into the cache if the key does not already exist in the cache.
|
V |
removeValue(K key)
Removes an entry from the cache.
|
boolean containsKey(K key)
key
- The key that the value is mapped to.Set<K> getKeys()
int getSize()
V getValue(K key)
key
- The key that the value is mapped to.V putValueIfAbsent(K key, V value)
key
- The key that the value is mapped to.value
- The value to be cached.Copyright © 2018 Liferay, Inc.. All rights reserved.