Class GuavaCache<K,V>
java.lang.Object
org.incendo.cloud.processors.cache.GuavaCache<K,V>
- Type Parameters:
K- key typeV- value type
- All Implemented Interfaces:
CloudCache<K,V>
@API(status=STABLE,
since="1.0.0")
public final class GuavaCache<K,V>
extends Object
implements CloudCache<K,V>
An implementation of
CloudCache backed by a Guava Cache.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidDeletes the entry identified by the givenkey.getIfPresent(@NonNull K key) Returns the value identified by the givenkey, if it exists.static <K,V> @NonNull CloudCache<K, V> Creates a newGuavaCachebacked by the given Guavacache.voidStores the givenvalueidentified by the givenkey.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.incendo.cloud.processors.cache.CloudCache
get, keyExtractingView, popIfPresent
-
Method Details
-
of
Creates a newGuavaCachebacked by the given Guavacache.- Type Parameters:
K- key typeV- value type- Parameters:
cache- backing cache- Returns:
- the created cache instance
-
delete
Description copied from interface:CloudCacheDeletes the entry identified by the givenkey.- Specified by:
deletein interfaceCloudCache<K,V> - Parameters:
key- the key
-
put
Description copied from interface:CloudCacheStores the givenvalueidentified by the givenkey.- Specified by:
putin interfaceCloudCache<K,V> - Parameters:
key- the keyvalue- the value
-
getIfPresent
Description copied from interface:CloudCacheReturns the value identified by the givenkey, if it exists.- Specified by:
getIfPresentin interfaceCloudCache<K,V> - Parameters:
key- the key- Returns:
- the value, or
null
-