Package kong.unirest.core
Interface Cache.Key
-
- 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(Object obj)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(Object obj)
- Overrides:
equalsin classObject- 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 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
-
-