Package kong.unirest
Interface Cache.Key
-
- 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
equals(Object obj)
Instant
getTime()
The time the key was created to be used by purging functionsint
hashCode()
As much as is reasonably practical, the hashCode method defined by classObject
does return distinct integers for distinct objects.
-
-
-
Method Detail
-
equals
boolean equals(Object obj)
- Overrides:
equals
in classObject
- 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()
,HashMap
-
hashCode
int hashCode()
As much as is reasonably practical, the hashCode method defined by classObject
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 classObject
- Returns:
- a hash code value for this object.
- See Also:
Object.equals(java.lang.Object)
,System.identityHashCode(java.lang.Object)
-
getTime
Instant getTime()
The time the key was created to be used by purging functions- Returns:
- the time as an instant
-
-