Package com.okta.sdk.cache
Interface Cache<K,V>
-
public interface Cache<K,V>
A Cache efficiently stores temporary objects primarily to improve an application's performance.This interface provides an abstraction (wrapper) API on top of an underlying cache framework's cache instance (e.g. JCache, Ehcache, Hazelcast, JCS, OSCache, JBossCache, TerraCotta, Coherence, GigaSpaces, etc, etc), allowing a Okta SDK user to configure any cache mechanism they choose.
- Since:
- 0.5.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description V
get(K key)
Returns the cached value stored under the specifiedkey
ornull
if there is no cache entry for thatkey
.V
put(K key, V value)
Adds a cache entry.V
remove(K key)
Removes the cached value stored under the specifiedkey
.
-
-
-
Method Detail
-
get
V get(K key)
Returns the cached value stored under the specifiedkey
ornull
if there is no cache entry for thatkey
.- Parameters:
key
- the key that the value was previous added with- Returns:
- the cached object or
null
if there is no entry for the specifiedkey
-
put
V put(K key, V value)
Adds a cache entry.- Parameters:
key
- the key used to identify the object being stored.value
- the value to be stored in the cache.- Returns:
- the previous value associated with the given
key
ornull
if there was no previous value
-
-