Interface SoftReferenceCache.CacheReference
- All Known Implementing Classes:
SoftReferenceCache.HardCacheReference, SoftReferenceCache.SoftCacheReference
- Enclosing class:
SoftReferenceCache
protected static interface SoftReferenceCache.CacheReference
-
Method Summary
Modifier and TypeMethodDescriptionget()Returns the referenced value, or null if it is no longer available.Returns the expiry deadline, or null when this reference does not expire by time.getId()Returns the cache key associated with this reference.default booleanhasExpired(Clock clock) Returns whether a non-null deadline is strictly before the supplied clock's current instant; equality is not expired.
-
Method Details
-
getId
Object getId()Returns the cache key associated with this reference. -
get
Object get()Returns the referenced value, or null if it is no longer available. -
getDeadline
Instant getDeadline()Returns the expiry deadline, or null when this reference does not expire by time. -
hasExpired
Returns whether a non-null deadline is strictly before the supplied clock's current instant; equality is not expired.
-