Interface Cache.Key

All Known Implementing Classes:
CacheManager.HashKey
Enclosing interface:
Cache

public static interface Cache.Key
Interface for the cache key which can be implemented by consumers The key should implement equals and hashCode It must must return the time the key was created.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    The time the key was created to be used by purging functions
    int
    As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects.
  • Method Details

    • equals

      boolean equals(Object obj)
      Overrides:
      equals in class Object
      Parameters:
      obj - the reference object with which to compare.
      Returns:
      true if this object is the same as the obj argument; false otherwise.
      See Also:
    • hashCode

      int hashCode()
      As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (The hashCode may or may not be implemented as some function of an object's memory address at some point in time.)
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object.
      See Also:
    • getTime

      Instant getTime()
      The time the key was created to be used by purging functions
      Returns:
      the time as an instant