Package io.quarkus.cache.runtime.noop
Class NoOpCache
- java.lang.Object
-
- io.quarkus.cache.runtime.AbstractCache
-
- io.quarkus.cache.runtime.noop.NoOpCache
-
- All Implemented Interfaces:
Cache
public class NoOpCache extends AbstractCache
This class is an internal Quarkus cache implementation. Do not use it explicitly from your Quarkus application. The public methods signatures may change without prior notice.
-
-
Field Summary
-
Fields inherited from class io.quarkus.cache.runtime.AbstractCache
NULL_KEYS_NOT_SUPPORTED_MSG
-
-
Constructor Summary
Constructors Constructor Description NoOpCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,V>
io.smallrye.mutiny.Uni<V>get(K key, Function<K,V> valueLoader)
Returns a lazy asynchronous action that will emit the cache value identified bykey
, obtaining that value fromvalueLoader
if necessary.<K,V>
io.smallrye.mutiny.Uni<V>getAsync(K key, Function<K,io.smallrye.mutiny.Uni<V>> valueLoader)
Returns a lazy asynchronous action that will emit the cache value identified bykey
, obtaining that value fromvalueLoader
if necessary.String
getName()
Returns the cache name.io.smallrye.mutiny.Uni<Void>
invalidate(Object key)
Removes the cache entry identified bykey
from the cache.io.smallrye.mutiny.Uni<Void>
invalidateAll()
Removes all entries from the cache.io.smallrye.mutiny.Uni<Void>
invalidateIf(Predicate<Object> predicate)
Removes all cache entries whose keys match the given predicate.-
Methods inherited from class io.quarkus.cache.runtime.AbstractCache
as, getDefaultKey
-
-
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:Cache
Returns the cache name.- Returns:
- cache name
-
get
public <K,V> io.smallrye.mutiny.Uni<V> get(K key, Function<K,V> valueLoader)
Description copied from interface:Cache
Returns a lazy asynchronous action that will emit the cache value identified bykey
, obtaining that value fromvalueLoader
if necessary.- Type Parameters:
K
- cache key typeV
- cache value type- Parameters:
key
- cache keyvalueLoader
- function used to compute a cache value ifkey
is not already associated with a value- Returns:
- a lazy asynchronous action that will emit a cache value
-
getAsync
public <K,V> io.smallrye.mutiny.Uni<V> getAsync(K key, Function<K,io.smallrye.mutiny.Uni<V>> valueLoader)
Description copied from interface:Cache
Returns a lazy asynchronous action that will emit the cache value identified bykey
, obtaining that value fromvalueLoader
if necessary.- Returns:
- a lazy asynchronous action that will emit a cache value
-
invalidate
public io.smallrye.mutiny.Uni<Void> invalidate(Object key)
Description copied from interface:Cache
Removes the cache entry identified bykey
from the cache. If the key does not identify any cache entry, nothing will happen.- Parameters:
key
- cache key
-
invalidateAll
public io.smallrye.mutiny.Uni<Void> invalidateAll()
Description copied from interface:Cache
Removes all entries from the cache.
-
-