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 Details
-
hashCode
private final int hashCode -
e
-
-
Constructor Details
-
LookupKeyReference
-
-
Method Details
-
get
Description copied from interface:References.InternalReferenceReturns 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:
getin interfaceReferences.InternalReference<E>- Returns:
- The object to which this reference refers, or
nullif this reference object has been cleared
-
getKeyReference
Description copied from interface:References.InternalReferenceReturns 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.WeakKeyReferenceis returned.- Specified by:
getKeyReferencein interfaceReferences.InternalReference<E>- Returns:
- the key that is associated to the cached entry
-
equals
-
hashCode
-