public interface CacheEntry<K,V>
null
or contains an exception. Entries can be retrieved by
Cache.peekEntry(Object)
or Cache.getEntry(Object)
or
via iterated via Cache.entries()
.
After retrieved, the entry instance does not change its values, even if the value for its key is updated in the cache.
Design note: The cache is generally also aware of the time the object will be refreshed next or when it will expire. This is not exposed to applications by intention.
Cache.peekEntry(Object)
,
Cache.getEntry(Object)
,
Cache.entries()
Modifier and Type | Method and Description |
---|---|
Throwable |
getException()
The exception happened when the value was loaded and
the exception could not be suppressed.
|
K |
getKey()
Key associated with this entry.
|
long |
getLastModification()
Time in millis the entry was last modified.
|
V |
getValue()
Value of the entry.
|
K getKey()
V getValue()
CacheLoaderException
- if the loading produced an exception .Throwable getException()
null
if no exception
happened or it was suppressed. If null
then getValue()
returns a value and does not throw an exception.long getLastModification()
cache2k API documentation. Copyright © 2000–2017 headissue GmbH, Munich.