Constructor and Description |
---|
CacheWrapper() |
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.
|
public boolean containsKey(K key)
Cache
containsKey
in interface Cache<K,V>
key
- The key that the value is mapped to.Cache.containsKey(java.lang.Object)
public Set<K> getKeys()
Cache
getKeys
in interface Cache<K,V>
Cache.getKeys()
public int getSize()
Cache
getSize
in interface Cache<K,V>
Cache.getSize()
public V getValue(K key)
Cache
getValue
in interface Cache<K,V>
key
- The key that the value is mapped to.Cache.getValue(java.lang.Object)
public V putValueIfAbsent(K key, V value)
Cache
putValueIfAbsent
in interface Cache<K,V>
key
- The key that the value is mapped to.value
- The value to be cached.Cache.putValueIfAbsent(java.lang.Object, java.lang.Object)
public V removeValue(K key)
Cache
removeValue
in interface Cache<K,V>
key
- The key that the value is mapped to.Cache.removeValue(java.lang.Object)
Copyright © 2018 Liferay, Inc.. All rights reserved.