Cache implementation suitable for disabling caching.
Will simply accept any items into the cache not actually storing them.
NoOpCacheManager
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Implements org. |
| public void | evict(Object
the key whose mapping is to be removed from the cache key)Implements org. |
| public boolean | evictIfPresent(Object
the key whose mapping is to be removed from the cache key)Overrides default org. |
| public Cache. | get(Object
the key whose associated value is to be returned key)Implements org. |
| public <T> T | get(Object
the key whose associated value is to be returned key, Class<T> the required type of the returned value (may be
type)null to bypass a type check; in case of a null
value found in the cache, the specified type is irrelevant)Implements org. |
| public <T> T | get(Object
the key whose associated value is to be returned key, Callable<T> valueLoader)Implements org. valueLoader if necessary.
|
| public String | |
| public Object | getNativeCache()
Implements org. |
| public boolean | invalidate()
Overrides default org. |
| public void | put(Object
the key with which the specified value is to be associated key, Object the value to be associated with the specified key value)Implements org. |
| public Cache. | putIfAbsent(Object
the key with which the specified value is to be associated key, Object the value to be associated with the specified key value)Overrides default org. |
| public CompletableFuture | retrieve(Object
the key whose associated value is to be returned key)Overrides default org. CompletableFuture.
|
| public <T> CompletableFuture | retrieve(Object
the key whose associated value is to be returned key, Supplier<CompletableFuture<T>> valueLoader)Overrides default org. valueLoader if necessary.
|
| name | back to summary |
|---|---|
| private final String name | |
| NoOpCache | back to summary |
|---|---|
| public NoOpCache(String name) Create a
| |
| clear | back to summary |
|---|---|
| public void clear() Implements org. Doc from org. Clear the cache through removing all mappings. Actual clearing may be performed in an asynchronous or deferred
fashion, with subsequent lookups possibly still seeing the entries.
This may for example be the case with transactional cache decorators.
Use If the cache is supposed to be compatible with
| |
| evict | back to summary |
|---|---|
| public void evict(Object key) Implements org. Doc from org. Evict the mapping for this key from this cache if it is present. Actual eviction may be performed in an asynchronous or deferred
fashion, with subsequent lookups possibly still seeing the entry.
This may for example be the case with transactional cache decorators.
Use If the cache is supposed to be compatible with | |
| evictIfPresent | back to summary |
|---|---|
| public boolean evictIfPresent(Object key) Overrides default org. Doc from org. Evict the mapping for this key from this cache if it is present, expecting the key to be immediately invisible for subsequent lookups. The default implementation delegates to | |
| get | back to summary |
|---|---|
| public Cache. Implements org. Doc from org. Return the value to which this cache maps the specified key. Returns
| |
| get | back to summary |
|---|---|
| public <T> T get(Object key, Class<T> type) Implements org. Doc from org. Return the value to which this cache maps the specified key, generically specifying a type that return value will be cast to. Note This variant of
| |
| get | back to summary |
|---|---|
| public <T> T get(Object key, Callable<T> valueLoader) Implements org. Doc from org. Return the value to which this cache maps the specified key, obtaining
that value from If possible, implementations should ensure that the loading operation
is synchronized so that the specified If the | |
| getName | back to summary |
|---|---|
| public String getName() Implements org. Doc from org. Return the cache name.
| |
| getNativeCache | back to summary |
|---|---|
| public Object getNativeCache() Implements org. Doc from org. Return the underlying native cache provider.
| |
| invalidate | back to summary |
|---|---|
| public boolean invalidate() Overrides default org. Doc from org. Invalidate the cache through removing all mappings, expecting all entries to be immediately invisible for subsequent lookups.
| |
| put | back to summary |
|---|---|
| public void put(Object key, Object value) Implements org. Doc from org. Associate the specified value with the specified key in this cache. If the cache previously contained a mapping for this key, the old value is replaced by the specified value. Actual registration may be performed in an asynchronous or deferred
fashion, with subsequent lookups possibly not seeing the entry yet.
This may for example be the case with transactional cache decorators.
Use If the cache is supposed to be compatible with | |
| putIfAbsent | back to summary |
|---|---|
| public Cache. Overrides default org. Doc from org. Atomically associate the specified value with the specified key in this cache if it is not set already. This is equivalent to:
except that the action is performed atomically. While all out-of-the-box
CacheManager implementations are able to perform the put atomically,
the operation may also be implemented in two steps, e.g. with a check for
presence and a subsequent put, in a non-atomic way. Check the documentation
of the native cache implementation that you are using for more details.
The default implementation delegates to
| |
| retrieve | back to summary |
|---|---|
| public CompletableFuture Overrides default org. Doc from org. Return the value to which this cache maps the specified key,
wrapped in a Can return
| |
| retrieve | back to summary |
|---|---|
| public <T> CompletableFuture Overrides default org. Doc from org. Return the value to which this cache maps the specified key, obtaining
that value from If possible, implementations should ensure that the loading operation
is synchronized so that the specified Null values always indicate a user-level
| |