Package com.okta.sdk.impl.cache
Class DefaultCache.Entry<V>
java.lang.Object
com.okta.sdk.impl.cache.DefaultCache.Entry<V>
- Type Parameters:
V
- the type of value that is stored in the cache.
- Enclosing class:
DefaultCache<K,
V>
An Entry is a wrapper that encapsulates the actual
value
stored in the cache as well as
creationTimeMillis
and lastAccessTimeMillis
metadata about the entry itself. The creationTimeMillis
and lastAccessTimeMillis
values are used
to support expunging cache entries based on
timeToIdle
and
timeToLive
settings, respectively.-
Constructor Summary
ConstructorDescriptionCreates a new Entry instance wrapping the specifiedvalue
, defaulting both thecreationTimeMillis
and thelastAccessTimeMills
to the current timestamp (i.e. -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the creation time in millis since Epoch when thisEntry
instance was created.long
Returns the time in millis since Epoch when thisEntry
instance was last accessed.getValue()
Returns the actual value stored in the cache.
-
Constructor Details
-
Entry
Creates a new Entry instance wrapping the specifiedvalue
, defaulting both thecreationTimeMillis
and thelastAccessTimeMills
to the current timestamp (i.e.System.currentTimeMillis()
).- Parameters:
value
- the cache entry to store.
-
-
Method Details
-
getValue
Returns the actual value stored in the cache.- Returns:
- the actual value stored in the cache.
-
getCreationTimeMillis
public long getCreationTimeMillis()Returns the creation time in millis since Epoch when thisEntry
instance was created. This is used to support expunging cache entries when this value is older than the cache'stimeToLive
setting.- Returns:
- the creation time in millis since Epoch when this
Entry
instance was created.
-
getLastAccessTimeMillis
public long getLastAccessTimeMillis()Returns the time in millis since Epoch when thisEntry
instance was last accessed. This is used to support expunging cache entries when this value is older than the cache'stimeToIdle
setting.- Returns:
- the time in millis since Epoch when this
Entry
instance was last accessed.
-