public interface CacheManager<T>
Modifier and Type | Method and Description |
---|---|
void |
clear()
clear plugins cache
|
boolean |
contains(java.lang.String key)
Clear plugins cache.
|
java.util.Optional<T> |
get(java.lang.String key)
Returns a populated #
Optional if the value exists, otherwise Optional.empty(). |
T |
get(java.lang.String key,
java.util.function.BiFunction<java.lang.String,T,T> loader)
Get or load a value by supplying a key, value, and function.
|
T |
get(java.lang.String key,
java.util.function.Function<java.lang.String,T> loader)
Get or load a value by supplying a key and function.
|
void |
init(java.lang.String pluginType)
Initialize cache for pluginType
|
java.util.Optional<T> |
invalidate(java.lang.String key)
Invalidates, or removes the associated cache entry.
|
java.util.Optional<T> |
put(java.lang.String key,
T value)
Populate a cache with value.
|
void init(java.lang.String pluginType)
pluginType
- pluginTypejava.util.Optional<T> get(java.lang.String key)
Optional
if the value exists, otherwise Optional.empty().key
- keyjava.util.Optional<T> put(java.lang.String key, T value)
key
- keyvalue
- valueT get(java.lang.String key, java.util.function.Function<java.lang.String,T> loader)
Optional
, representing the existing value, if any.key
- keyloader
- loaderT get(java.lang.String key, java.util.function.BiFunction<java.lang.String,T,T> loader)
key
- keyloader
- bi function loaderjava.util.Optional<T> invalidate(java.lang.String key)
key
- keyOptional
if the entry existed, otherwise Optional.empty().boolean contains(java.lang.String key)
key
- keyvoid clear()