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
     
  • Method Summary

    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 by key, obtaining that value from valueLoader 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 by key, obtaining that value from valueLoader if necessary.
    Returns the cache name.
    io.smallrye.mutiny.Uni<Void>
    Removes the cache entry identified by key from the cache.
    io.smallrye.mutiny.Uni<Void>
    Removes all entries from the cache.
    io.smallrye.mutiny.Uni<Void>
    Removes all cache entries whose keys match the given predicate.

    Methods inherited from class io.quarkus.cache.runtime.AbstractCache

    as, getDefaultKey

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NoOpCache

      public NoOpCache()
  • Method Details

    • 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 by key, obtaining that value from valueLoader if necessary.
      Type Parameters:
      K - cache key type
      V - cache value type
      Parameters:
      key - cache key
      valueLoader - function used to compute a cache value if key 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 by key, obtaining that value from valueLoader if necessary.
      Type Parameters:
      K -
      V -
      Parameters:
      key -
      valueLoader -
      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 by key 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.
    • invalidateIf

      public io.smallrye.mutiny.Uni<Void> invalidateIf(Predicate<Object> predicate)
      Description copied from interface: Cache
      Removes all cache entries whose keys match the given predicate.
      Parameters:
      predicate -