K
- The class implemented by the cache keysV
- The class implemented by the cache valuespublic class XPFCache<K,V> extends Object
Modifier and Type | Field and Description |
---|---|
private net.sf.ehcache.Cache |
cache |
private XPFSynchronizedCacheSupport<K,V> |
synchronizedCacheSupport |
Constructor and Description |
---|
XPFCache(net.sf.ehcache.Cache cache)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private XPFCacheResult<V> |
get(K key) |
V |
get(K key,
Function<K,V> fallbackLoader)
Gets a value from the cache.
|
V |
put(K key,
V value)
Cache a value with a given key.
|
void |
remove(K key)
Remove a cached value.
|
private final net.sf.ehcache.Cache cache
private final XPFSynchronizedCacheSupport<K,V> synchronizedCacheSupport
public XPFCache(net.sf.ehcache.Cache cache)
cache
- the cachepublic V get(K key, Function<K,V> fallbackLoader)
key
- the name of the key to retrieve the object byfallbackLoader
- a cache loader to use to load the value if the value cannot be found in cachepublic V put(K key, V value)
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keypublic void remove(K key)
key
- key whose mapping is to be removed from the cacheprivate XPFCacheResult<V> get(K key)
Copyright © 2000–2021 Elastic Path Software, Inc. All rights reserved.