Interface RedisCache

All Superinterfaces:
Cache
All Known Implementing Classes:
RedisCacheImpl

public interface RedisCache extends Cache
  • Method Summary

    Modifier and Type
    Method
    Description
    <K, V> io.smallrye.mutiny.Uni<V>
    get(K key, Class<V> clazz, Function<K,V> valueLoader)
    Allows retrieving a value from the Redis cache.
    default <K, V> io.smallrye.mutiny.Uni<V>
    get(K key, Function<K,V> valueLoader)
     
    <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.
    default <K, V> io.smallrye.mutiny.Uni<V>
    getAsync(K key, Function<K,io.smallrye.mutiny.Uni<V>> valueLoader)
     
    When configured, gets the default type of the value stored in the cache.
    <K, V> io.smallrye.mutiny.Uni<V>
    getOrDefault(K key, V defaultValue)
     
    <K, V> io.smallrye.mutiny.Uni<V>
    getOrNull(K key, Class<V> clazz)
     
    <K, V> io.smallrye.mutiny.Uni<Void>
    put(K key, Supplier<V> supplier)
     
    default <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

      Class<?> getDefaultValueType()
      When configured, gets the default type of the value stored in the cache. The configured type is used when no type is passed into the get(Object, Class, Function).
      Returns:
      the type, null if not configured.
    • get

      default <K, V> io.smallrye.mutiny.Uni<V> get(K key, Function<K,V> valueLoader)
      Specified by:
      get in interface Cache
    • getAsync

      default <K, V> io.smallrye.mutiny.Uni<V> getAsync(K key, Function<K,io.smallrye.mutiny.Uni<V>> valueLoader)
      Specified by:
      getAsync in interface Cache
    • get

      <K, V> io.smallrye.mutiny.Uni<V> get(K key, Class<V> clazz, Function<K,V> valueLoader)
      Allows retrieving a value from the Redis cache.
      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      key - the key
      clazz - the class of the value
      valueLoader - 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 key
      V - the type of value
      Parameters:
      key - the key
      clazz - the class of the value
      valueLoader - the value loader called when there is no value stored in the cache
      Returns:
      the Uni emitting the cached value.
    • put

      default <K, V> io.smallrye.mutiny.Uni<Void> put(K key, V value)
      Put a value in the cache.
      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      key - the key
      value - the value
      Returns:
      a Uni emitting null when the operation completes
    • put

      <K, V> io.smallrye.mutiny.Uni<Void> put(K key, Supplier<V> supplier)
    • getOrDefault

      <K, V> io.smallrye.mutiny.Uni<V> getOrDefault(K key, V defaultValue)
    • getOrNull

      <K, V> io.smallrye.mutiny.Uni<V> getOrNull(K key, Class<V> clazz)