Interface SoftReferenceCache.CacheReference

All Known Implementing Classes:
SoftReferenceCache.HardCacheReference, SoftReferenceCache.SoftCacheReference
Enclosing class:
SoftReferenceCache

protected static interface SoftReferenceCache.CacheReference
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    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.
    Returns the cache key associated with this reference.
    default boolean
    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

      default boolean hasExpired(Clock clock)
      Returns whether a non-null deadline is strictly before the supplied clock's current instant; equality is not expired.