Class ProductConfigurationEHCacheAccessImpl<K extends CacheKey,V>
java.lang.Object
de.hybris.platform.sap.productconfig.runtime.interf.cache.impl.ProductConfigurationEHCacheAccessImpl<K,V>
- All Implemented Interfaces:
ProductConfigurationCacheAccess<K,V>
public class ProductConfigurationEHCacheAccessImpl<K extends CacheKey,V>
extends Object
implements ProductConfigurationCacheAccess<K,V>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves all elements from cache.Gets a value from the cache for the given key.protected EHCacheRegiongetCache()getKeys()Provide the keys of all values, which are currently in the cache region.getWithLoader(K key, CacheValueLoader<V> loader) Gets a value from the cache using the loader to get the value.getWithSupplier(K key, Supplier<V> supplier) Gets a value from the cache for the given key.voidPuts a value into the cache region.voidputIfAbsent(K key, V value) Puts a value into the cache region, only if no value with same key already exists.voidRemoves a value from the cache.voidsetCache(EHCacheRegion cache)
-
Constructor Details
-
ProductConfigurationEHCacheAccessImpl
public ProductConfigurationEHCacheAccessImpl()
-
-
Method Details
-
get
Description copied from interface:ProductConfigurationCacheAccessGets a value from the cache for the given key.- Specified by:
getin interfaceProductConfigurationCacheAccess<K extends CacheKey,V> - Parameters:
key- K of object which should be retrieved from the cache- Returns:
- the value or
nullif the value could not be found in the cache
-
getKeys
Description copied from interface:ProductConfigurationCacheAccessProvide the keys of all values, which are currently in the cache region.- Specified by:
getKeysin interfaceProductConfigurationCacheAccess<K extends CacheKey,V> - Returns:
- all keys.
-
getWithSupplier
Description copied from interface:ProductConfigurationCacheAccessGets a value from the cache for the given key. If the value is not present in the cache the supplier will be called and the returned value will be cached.- Specified by:
getWithSupplierin interfaceProductConfigurationCacheAccess<K extends CacheKey,V> - Parameters:
key- key of valuesupplier- supplier which returns the value- Returns:
- the value
-
getWithLoader
Description copied from interface:ProductConfigurationCacheAccessGets a value from the cache using the loader to get the value.- Specified by:
getWithLoaderin interfaceProductConfigurationCacheAccess<K extends CacheKey,V> - Parameters:
key- the key of the value which has to loadedloader- the loader object which is used to load the value- Returns:
- number of objects currently stored in the cache.
-
put
Description copied from interface:ProductConfigurationCacheAccessPuts a value into the cache region.- Specified by:
putin interfaceProductConfigurationCacheAccess<K extends CacheKey,V> - Parameters:
key- key of valuevalue- value which is put into the cache
-
putIfAbsent
Description copied from interface:ProductConfigurationCacheAccessPuts a value into the cache region, only if no value with same key already exists.- Specified by:
putIfAbsentin interfaceProductConfigurationCacheAccess<K extends CacheKey,V> - Parameters:
key- key of valuevalue- value which is put into the cache
-
remove
Description copied from interface:ProductConfigurationCacheAccessRemoves a value from the cache. The cached value cannot be longer used.- Specified by:
removein interfaceProductConfigurationCacheAccess<K extends CacheKey,V> - Parameters:
key- the key of the value which has to be removed from the cache
-
clearCache
public void clearCache()Description copied from interface:ProductConfigurationCacheAccessRemoves all elements from cache.- Specified by:
clearCachein interfaceProductConfigurationCacheAccess<K extends CacheKey,V>
-
getCache
-
setCache
-