| Constructor and Description |
|---|
NoOpSyncCache(String name)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
<T> Optional<T> |
get(Object key,
io.micronaut.core.type.Argument<T> requiredType)
Resolve the given value for the given key.
|
<T> T |
get(Object key,
io.micronaut.core.type.Argument<T> requiredType,
Supplier<T> supplier)
Resolve the given value for the given key.
|
String |
getName() |
Object |
getNativeCache() |
void |
invalidate(Object key)
Invalidate the value for the given key.
|
void |
invalidateAll()
Invalidate all cached values within this cache.
|
void |
put(Object key,
Object value)
Cache the specified value using the specified key.
|
<T> Optional<T> |
putIfAbsent(Object key,
T value)
Cache the specified value using the specified key if it is not already present.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasync, get, get, getExecutorService, putIfAbsentgetCacheInfopublic NoOpSyncCache(String name)
name - the cache name@NonNull public <T> Optional<T> get(@NonNull Object key, @NonNull io.micronaut.core.type.Argument<T> requiredType)
SyncCachepublic <T> T get(@NonNull
Object key,
@NonNull
io.micronaut.core.type.Argument<T> requiredType,
@NonNull
Supplier<T> supplier)
SyncCacheSupplier will
be invoked and the return value cached.get in interface SyncCache<Object>T - The concrete typekey - The cache keyrequiredType - The required typesupplier - The supplier that should be invoked if the value is not found@NonNull public <T> Optional<T> putIfAbsent(@NonNull Object key, @NonNull T value)
SyncCacheCache the specified value using the specified key if it is not already present.
putIfAbsent in interface SyncCache<Object>T - The concrete typekey - the key with which the specified value is to be associatedvalue - the value to be associated with the specified keyOptional.empty() if the specified value parameter was cachedpublic void put(@NonNull
Object key,
@NonNull
Object value)
SyncCacheCache the specified value using the specified key.
public void invalidate(@NonNull
Object key)
SyncCacheinvalidate in interface SyncCache<Object>key - The key to invalidpublic void invalidateAll()
SyncCacheinvalidateAll in interface SyncCache<Object>public String getName()
public Object getNativeCache()
getNativeCache in interface Cache<Object>