public interface Cache
| Modifier and Type | Method and Description |
|---|---|
<T> T |
get(String id,
Function<? super String,T> mappingFunction)
Returns the value associated with the given id.
|
<T> T |
getIfPresent(String id)
Returns the value associated with the given id if it exists in the cache.
|
void |
invalidate(String id)
Invalidates the cache entry mapped to given id.
|
void |
invalidateAll()
Invalidates all cache entries.
|
void |
put(String id,
Object value)
Adds or replaces a value in the cache.
|
void put(String id, Object value)
id - The object idvalue - The value to cache<T> T get(String id, Function<? super String,T> mappingFunction)
T - the type of object to return from the cacheid - The object idmappingFunction - The function to compute a value if the cache is not in the cache<T> T getIfPresent(String id)
null is returned.T - the type of object to return from the cacheid - The object idvoid invalidate(String id)
void invalidateAll()
Copyright © 2019 Flux Capacitor. All rights reserved.