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 fromvalueLoaderif necessary.StringgetName()Returns the cache name.io.smallrye.mutiny.Uni<Void>invalidate(Object key)Removes the cache entry identified bykeyfrom the cache.io.smallrye.mutiny.Uni<Void>invalidateAll()Removes all entries from the cache.io.smallrye.mutiny.Uni<Void>replaceUniValue(Object key, Object emittedValue)Replaces the cache value associated with the given key by an item emitted by aUni.-
Methods inherited from class io.quarkus.cache.runtime.AbstractCache
as, getDefaultKey
-
-
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:CacheReturns 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:CacheReturns a lazy asynchronous action that will emit the cache value identified bykey, obtaining that value fromvalueLoaderif necessary.- Type Parameters:
K- cache key typeV- cache value type- Parameters:
key- cache keyvalueLoader- function used to compute a cache value ifkeyis not already associated with a value- 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:CacheRemoves the cache entry identified bykeyfrom 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:CacheRemoves all entries from the cache.
-
replaceUniValue
public io.smallrye.mutiny.Uni<Void> replaceUniValue(Object key, Object emittedValue)
Description copied from class:AbstractCacheReplaces the cache value associated with the given key by an item emitted by aUni. This method can be called several times for the same key, each call will then always replace the existing cache entry with the given emitted value. If the key no longer identifies a cache entry, this method must not put the emitted item into the cache.- Specified by:
replaceUniValuein classAbstractCache
-
-