Package kong.unirest.core
Interface Cache.Key
-
- All Known Implementing Classes:
CacheManager.HashKey
- Enclosing interface:
- Cache
public static interface Cache.KeyInterface 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 booleanequals(java.lang.Object obj)java.time.InstantgetTime()The time the key was created to be used by purging functionsinthashCode()As much as is reasonably practical, the hashCode method defined by classObjectdoes return distinct integers for distinct objects.
-
-
-
Method Detail
-
equals
boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the reference object with which to compare.- Returns:
trueif this object is the same as the obj argument;falseotherwise.- See Also:
hashCode(),HashMap
-
hashCode
int hashCode()
As much as is reasonably practical, the hashCode method defined by classObjectdoes 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:
hashCodein classjava.lang.Object- Returns:
- a hash code value for this object.
- See Also:
Object.equals(java.lang.Object),System.identityHashCode(java.lang.Object)
-
getTime
java.time.Instant getTime()
The time the key was created to be used by purging functions- Returns:
- the time as an instant
-
-