Enum Class MultiKeyMap.CollectionKeyMode

java.lang.Object
java.lang.Enum<MultiKeyMap.CollectionKeyMode>
com.cedarsoftware.util.MultiKeyMap.CollectionKeyMode
All Implemented Interfaces:
Serializable, Comparable<MultiKeyMap.CollectionKeyMode>, Constable
Enclosing class:
MultiKeyMap<V>

public static enum MultiKeyMap.CollectionKeyMode extends Enum<MultiKeyMap.CollectionKeyMode>
Enum to control how Collections are handled in get/remove/containsKey operations.

IMPORTANT: Arrays are ALWAYS expanded regardless of this setting because they do not have meaningful equals()/hashCode() implementations and therefore cannot serve as useful keys in a Map's keySet().

This enum only affects Collection objects (List, Set, Queue, etc.) that may have custom equals()/hashCode() implementations.

  • Enum Constant Details

    • COLLECTIONS_EXPANDED

      public static final MultiKeyMap.CollectionKeyMode COLLECTIONS_EXPANDED
      Default behavior: Collections are always unpacked into multi-key lookups. Arrays are also always unpacked (regardless of this setting). No fallback to treating Collections as single keys.
    • COLLECTIONS_NOT_EXPANDED

      public static final MultiKeyMap.CollectionKeyMode COLLECTIONS_NOT_EXPANDED
      Collections are used as single keys (not unpacked). Allows Collections with custom equals/hashCode to be used as single keys. Arrays are still always unpacked (regardless of this setting).
  • Method Details

    • values

      public static MultiKeyMap.CollectionKeyMode[] 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 MultiKeyMap.CollectionKeyMode 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