Enum Class NodeFactory

java.lang.Object
java.lang.Enum<NodeFactory>
com.github.benmanes.caffeine.cache.NodeFactory
All Implemented Interfaces:
Serializable, Comparable<NodeFactory>, Constable

enum NodeFactory extends Enum<NodeFactory>
WARNING: GENERATED CODE A factory for cache nodes optimized for a particular configuration.
  • Enum Constant Details

  • Field Details

  • Constructor Details

    • NodeFactory

      private NodeFactory()
  • Method Details

    • values

      public static NodeFactory[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static NodeFactory valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • newNode

      abstract <K, V> Node<K,V> newNode(K key, ReferenceQueue<K> keyReferenceQueue, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now)
      Returns a node optimized for the specified features.
    • newNode

      abstract <K, V> Node<K,V> newNode(Object keyReference, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now)
      Returns a node optimized for the specified features.
    • newLookupKey

      <K> Object newLookupKey(K 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 a References.LookupKeyReference<K> holding the key argument is returned.
    • newReferenceKey

      <K> Object newReferenceKey(K key, 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 a References.WeakKeyReference<K> holding the key argument is returned.
    • weakValues

      boolean weakValues()
      Returns whether this factory supports the weak values.
    • softValues

      boolean softValues()
      Returns whether this factory supports the soft values.
    • getFactory

      static NodeFactory getFactory(boolean strongKeys, boolean weakKeys, boolean strongValues, boolean weakValues, boolean softValues, boolean expiresAfterAccess, boolean expiresAfterWrite, boolean refreshAfterWrite, boolean maximumSize, boolean weighed)
      Returns a factory optimized for the specified features.