Package com.okta.sdk.cache
Interface Cache<K,V>
- All Known Implementing Classes:
DefaultCache
,DisabledCache
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
-
Method Details
-
get
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
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
-
remove
Removes the cached value stored under the specifiedkey
.- Parameters:
key
- the key used to identify the object being stored.- Returns:
- the removed value or
null
if there was no value cached.
-