Interface CloudCache<K,V>
- Type Parameters:
K- key typeV- value type
- All Known Implementing Classes:
CaffeineCache,GuavaCache,SimpleCache
Something that caches values.
Standard implementations:
GuavaCache: Implementation for GuavaCaffeineCache: Implementation for Caffeine
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidDeletes the entry identified by the givenkey.Returns the value identified by the givenkey.getIfPresent(@NonNull K key) Returns the value identified by the givenkey, if it exists.default <K1> @NonNull CloudCache<K1,V> keyExtractingView(@NonNull Function<K1, K> keyExtractor) Returns a view of this cache with an adapted key type.popIfPresent(@NonNull K key) Deletes the value identified by the givenkeyand returns the value.voidStores the givenvalueidentified by the givenkey.
-
Method Details
-
delete
Deletes the entry identified by the givenkey.- Parameters:
key- the key
-
put
Stores the givenvalueidentified by the givenkey.- Parameters:
key- the keyvalue- the value
-
getIfPresent
Returns the value identified by the givenkey, if it exists.- Parameters:
key- the key- Returns:
- the value, or
null
-
popIfPresent
Deletes the value identified by the givenkeyand returns the value.- Parameters:
key- the key- Returns:
- the value, or
null
-
get
Returns the value identified by the givenkey.- Parameters:
key- the key- Returns:
- the value
-
keyExtractingView
Returns a view of this cache with an adapted key type.- Type Parameters:
K1- key type for the view- Parameters:
keyExtractor- key extractor- Returns:
- new view
-