Package io.quarkus.cache.runtime
Class AbstractCache
- java.lang.Object
-
- io.quarkus.cache.runtime.AbstractCache
-
- All Implemented Interfaces:
Cache
- Direct Known Subclasses:
CaffeineCacheImpl
,NoOpCache
public abstract class AbstractCache extends Object implements Cache
-
-
Field Summary
Fields Modifier and Type Field Description static String
NULL_KEYS_NOT_SUPPORTED_MSG
-
Constructor Summary
Constructors Constructor Description AbstractCache()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <T extends Cache>
Tas(Class<T> type)
Returns this cache as an instance of the provided type if possible.Object
getDefaultKey()
Returns the unique and immutable default key for the current cache.abstract 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.cache.Cache
get, getName, invalidate, invalidateAll
-
-
-
-
Field Detail
-
NULL_KEYS_NOT_SUPPORTED_MSG
public static final String NULL_KEYS_NOT_SUPPORTED_MSG
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDefaultKey
public Object getDefaultKey()
Description copied from interface:Cache
Returns the unique and immutable default key for the current cache. This key is used by the annotations caching API when a no-args method annotated withCacheResult
orCacheInvalidate
is invoked. It can also be used with the programmatic caching API.- Specified by:
getDefaultKey
in interfaceCache
- Returns:
- default cache key
-
as
public <T extends Cache> T as(Class<T> type)
Description copied from interface:Cache
Returns this cache as an instance of the provided type if possible.
-
replaceUniValue
public abstract 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
. 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.
-
-