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ED CODE A factory for cache nodes optimized for a particular configuration.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Object
DEAD_STRONG_KEY
static References.WeakKeyReference<java.lang.Object>
DEAD_WEAK_KEY
static java.lang.Object
RETIRED_STRONG_KEY
static References.WeakKeyReference<java.lang.Object>
RETIRED_WEAK_KEY
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static <K,V>
NodeFactory<K,V>newFactory(Caffeine<K,V> builder, boolean isAsync)
Returns a factory optimized for the specified features.default java.lang.Object
newLookupKey(java.lang.Object key)
Returns a key suitable for looking up an entry in the cache.Node<K,V>
newNode(java.lang.Object keyReference, V value, java.lang.ref.ReferenceQueue<V> valueReferenceQueue, int weight, long now)
Returns a node optimized for the specified features.Node<K,V>
newNode(K key, java.lang.ref.ReferenceQueue<K> keyReferenceQueue, V value, java.lang.ref.ReferenceQueue<V> valueReferenceQueue, int weight, long now)
Returns a node optimized for the specified features.default java.lang.Object
newReferenceKey(K key, java.lang.ref.ReferenceQueue<K> referenceQueue)
Returns a key suitable for inserting into the cache.default boolean
softValues()
Returns whether this factory supports soft values.default boolean
weakValues()
Returns whether this factory supports weak values.
-
-
-
Field Detail
-
RETIRED_STRONG_KEY
static final java.lang.Object RETIRED_STRONG_KEY
-
DEAD_STRONG_KEY
static final java.lang.Object DEAD_STRONG_KEY
-
RETIRED_WEAK_KEY
static final References.WeakKeyReference<java.lang.Object> RETIRED_WEAK_KEY
-
DEAD_WEAK_KEY
static final References.WeakKeyReference<java.lang.Object> DEAD_WEAK_KEY
-
-
Method Detail
-
newNode
Node<K,V> newNode(K key, java.lang.ref.ReferenceQueue<K> keyReferenceQueue, V value, java.lang.ref.ReferenceQueue<V> valueReferenceQueue, int weight, long now)
Returns a node optimized for the specified features.
-
newNode
Node<K,V> newNode(java.lang.Object keyReference, V value, java.lang.ref.ReferenceQueue<V> valueReferenceQueue, int weight, long now)
Returns a node optimized for the specified features.
-
newReferenceKey
default java.lang.Object newReferenceKey(K key, java.lang.ref.ReferenceQueue<K> referenceQueue)
Returns a key suitable for inserting into the cache. If the cache holds keys strongly then the key is returned. If the cache holds keys weakly then aReferences.WeakKeyReference
holding the key argument is returned.
-
newLookupKey
default java.lang.Object newLookupKey(java.lang.Object key)
Returns a key suitable for looking up an entry in the cache. If the cache holds keys strongly then the key is returned. If the cache holds keys weakly then aReferences.LookupKeyReference
holding the key argument is returned.
-
newFactory
static <K,V> NodeFactory<K,V> newFactory(Caffeine<K,V> builder, boolean isAsync)
Returns a factory optimized for the specified features.
-
weakValues
default boolean weakValues()
Returns whether this factory supports weak values.
-
softValues
default boolean softValues()
Returns whether this factory supports soft values.
-
-