Package io.quarkus.cache.redis.runtime
Interface RedisCache
- All Superinterfaces:
Cache
- All Known Implementing Classes:
RedisCacheImpl
-
Method Summary
Modifier and TypeMethodDescription<K,V> io.smallrye.mutiny.Uni<V> Allows retrieving a value from the Redis cache.<K,V> io.smallrye.mutiny.Uni<V> Allows retrieving a value from the Redis cache.<K,V> io.smallrye.mutiny.Uni<V> <K,V> io.smallrye.mutiny.Uni<V> getAsync(K key, jakarta.enterprise.util.TypeLiteral<V> type, Function<K, io.smallrye.mutiny.Uni<V>> valueLoader) Allows retrieving a value from the Redis cache.<K,V> io.smallrye.mutiny.Uni<V> Allows retrieving a value from the Redis cache.<K,V> io.smallrye.mutiny.Uni<V> Class<?>Deprecated.should have never been exposed publicly<K,V> io.smallrye.mutiny.Uni<V> getOrDefault(K key, jakarta.enterprise.util.TypeLiteral<V> type, V defaultValue) ReturnsUnithat completes with a value present in the cache under the givenkey.<K,V> io.smallrye.mutiny.Uni<V> getOrDefault(K key, Class<V> clazz, V defaultValue) ReturnsUnithat completes with a value present in the cache under the givenkey.<K,V> io.smallrye.mutiny.Uni<V> getOrDefault(K key, V defaultValue) ReturnsUnithat completes with a value present in the cache under the givenkey.<K,V> io.smallrye.mutiny.Uni<V> getOrNull(K key) ReturnsUnithat completes with a value present in the cache under the givenkey.<K,V> io.smallrye.mutiny.Uni<V> getOrNull(K key, jakarta.enterprise.util.TypeLiteral<V> type) ReturnsUnithat completes with a value present in the cache under the givenkey.<K,V> io.smallrye.mutiny.Uni<V> ReturnsUnithat completes with a value present in the cache under the givenkey.<K,V> io.smallrye.mutiny.Uni<Void> Put a value in the cache.<K,V> io.smallrye.mutiny.Uni<Void> put(K key, V value) Put a value in the cache.Methods inherited from interface io.quarkus.cache.Cache
as, getDefaultKey, getName, invalidate, invalidateAll, invalidateIf
-
Method Details
-
getDefaultValueType
Deprecated.should have never been exposed publiclyWhen configured, gets the default type of the value stored in the cache. The configured type is used in methodsget(Object, Function),getAsync(Object, Function),getOrDefault(Object, Object)andgetOrNull(Object).- Returns:
- the type,
nullif not configured or if not aClass.
-
get
-
getAsync
-
get
Allows retrieving a value from the Redis cache.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
key- the keyclazz- the class of the valuevalueLoader- the value loader called when there is no value stored in the cache- Returns:
- the Uni emitting the cached value.
-
get
<K,V> io.smallrye.mutiny.Uni<V> get(K key, jakarta.enterprise.util.TypeLiteral<V> type, Function<K, V> valueLoader) Allows retrieving a value from the Redis cache.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
key- the keytype- the type of the valuevalueLoader- the value loader called when there is no value stored in the cache- Returns:
- the Uni emitting the cached value.
-
getAsync
<K,V> io.smallrye.mutiny.Uni<V> getAsync(K key, Class<V> clazz, Function<K, io.smallrye.mutiny.Uni<V>> valueLoader) Allows retrieving a value from the Redis cache.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
key- the keyclazz- the class of the valuevalueLoader- the value loader called when there is no value stored in the cache- Returns:
- the Uni emitting the cached value.
-
getAsync
<K,V> io.smallrye.mutiny.Uni<V> getAsync(K key, jakarta.enterprise.util.TypeLiteral<V> type, Function<K, io.smallrye.mutiny.Uni<V>> valueLoader) Allows retrieving a value from the Redis cache.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
key- the keytype- the type of the valuevalueLoader- the value loader called when there is no value stored in the cache- Returns:
- the Uni emitting the cached value.
-
put
Put a value in the cache.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
key- the keyvalue- the value- Returns:
- a Uni emitting
nullwhen the operation completes
-
put
Put a value in the cache.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
key- the keysupplier- supplier of the value- Returns:
- a Uni emitting
nullwhen the operation completes
-
getOrDefault
<K,V> io.smallrye.mutiny.Uni<V> getOrDefault(K key, V defaultValue) ReturnsUnithat completes with a value present in the cache under the givenkey. If there is no value in the cache under the key, theUnicompletes with the givendefaultValue.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
key- the keydefaultValue- the default value- Returns:
- a Uni emitting the value cached under
key, ordefaultValueif there is no cached value
-
getOrDefault
ReturnsUnithat completes with a value present in the cache under the givenkey. If there is no value in the cache under the key, theUnicompletes with the givendefaultValue.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
key- the keyclazz- class of the valuedefaultValue- the default value- Returns:
- a Uni emitting the value cached under
key, ordefaultValueif there is no cached value
-
getOrDefault
<K,V> io.smallrye.mutiny.Uni<V> getOrDefault(K key, jakarta.enterprise.util.TypeLiteral<V> type, V defaultValue) ReturnsUnithat completes with a value present in the cache under the givenkey. If there is no value in the cache under the key, theUnicompletes with the givendefaultValue.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
key- the keytype- type of the valuedefaultValue- the default value- Returns:
- a Uni emitting the value cached under
key, ordefaultValueif there is no cached value
-
getOrNull
<K,V> io.smallrye.mutiny.Uni<V> getOrNull(K key) ReturnsUnithat completes with a value present in the cache under the givenkey. If there is no value in the cache under the key, theUnicompletes withnull.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
key- the key- Returns:
- a Uni emitting the value cached under
key, ornullif there is no cached value
-
getOrNull
ReturnsUnithat completes with a value present in the cache under the givenkey. If there is no value in the cache under the key, theUnicompletes withnull.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
key- the keyclazz- the class of the value- Returns:
- a Uni emitting the value cached under
key, ornullif there is no cached value
-
getOrNull
<K,V> io.smallrye.mutiny.Uni<V> getOrNull(K key, jakarta.enterprise.util.TypeLiteral<V> type) ReturnsUnithat completes with a value present in the cache under the givenkey. If there is no value in the cache under the key, theUnicompletes withnull.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
key- the keytype- the type of the value- Returns:
- a Uni emitting the value cached under
key, ornullif there is no cached value
-