Class References.LookupKeyReference<E>
java.lang.Object
com.github.benmanes.caffeine.cache.References.LookupKeyReference<E>
- All Implemented Interfaces:
References.InternalReference<E>
- Enclosing class:
- References
static final class References.LookupKeyReference<E>
extends Object
implements References.InternalReference<E>
A short-lived adapter used for looking up an entry in the cache where the keys are weakly held.
This References.InternalReference implementation is not suitable for storing in the cache as
the key is strongly held.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.github.benmanes.caffeine.cache.References.InternalReference
referenceEquals
-
Field Details
-
hashCode
private final int hashCode -
e
-
-
Constructor Details
-
LookupKeyReference
-
-
Method Details
-
get
Description copied from interface:References.InternalReference
Returns this reference object's referent. If this reference object has been cleared, either by the program or by the garbage collector, then this method returnsnull
.- Specified by:
get
in interfaceReferences.InternalReference<E>
- Returns:
- The object to which this reference refers, or
null
if this reference object has been cleared
-
getKeyReference
Description copied from interface:References.InternalReference
Returns the key that is associated to the cache entry holding this reference. If the cache holds keys strongly, this is that key instance. Otherwise the cache holds keys weakly and theReferences.WeakKeyReference
is returned.- Specified by:
getKeyReference
in interfaceReferences.InternalReference<E>
- Returns:
- the key that is associated to the cached entry
-
equals
-
hashCode
public int hashCode()
-