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>
Controls how Collections are treated when used as keys in MultiKeyMap.

Note: Arrays are ALWAYS expanded regardless of this setting, as they cannot override equals/hashCode and would only compare by identity (==).

Since:
3.6.0
  • Enum Constant Details

    • COLLECTIONS_EXPANDED

      public static final MultiKeyMap.CollectionKeyMode COLLECTIONS_EXPANDED
      Collections are automatically unpacked into multi-key entries (default behavior). A List.of("a", "b", "c") becomes a 3-dimensional key equivalent to calling getMultiKey("a", "b", "c").
    • COLLECTIONS_NOT_EXPANDED

      public static final MultiKeyMap.CollectionKeyMode COLLECTIONS_NOT_EXPANDED
      Collections are treated as single key objects and not unpacked. A List.of("a", "b", "c") remains as a single Collection key. Use this mode when you want Collections to be compared by their equals() method rather than being expanded into multi-dimensional keys.
  • 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