Class ExpandableMap<K,V>

java.lang.Object
java.util.AbstractMap<K,V>
org.ethelred.util.collect.ExpandableMap<K,V>
Type Parameters:
K - key type
V - value type
All Implemented Interfaces:
Map<K,V>

public class ExpandableMap<K,V> extends AbstractMap<K,V>
Like Map.of(), but can produce copies with elements added.
  • Method Details

    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<K,V>
      Overrides:
      containsKey in class AbstractMap<K,V>
    • containsValue

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<K,V>
      Overrides:
      containsValue in class AbstractMap<K,V>
    • entrySet

      public Set<Map.Entry<K,V>> entrySet()
      Specified by:
      entrySet in interface Map<K,V>
      Specified by:
      entrySet in class AbstractMap<K,V>
    • get

      public V get(Object key)
      Specified by:
      get in interface Map<K,V>
      Overrides:
      get in class AbstractMap<K,V>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<K,V>
      Overrides:
      isEmpty in class AbstractMap<K,V>
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map<K,V>
      Overrides:
      hashCode in class AbstractMap<K,V>
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Map<K,V>
      Overrides:
      equals in class AbstractMap<K,V>
    • keySet

      public Set<K> keySet()
      Specified by:
      keySet in interface Map<K,V>
      Overrides:
      keySet in class AbstractMap<K,V>
    • of

      public static <K1, V1> ExpandableMap<K1,V1> of()
    • of

      public static <K1, V1> ExpandableMap<K1,V1> of(K1 k1, V1 v1)
    • of

      public static <K1, V1> ExpandableMap<K1,V1> of(K1 k1, V1 v1, K1 k2, V1 v2)
    • of

      public static <K1, V1> ExpandableMap<K1,V1> of(K1 k1, V1 v1, K1 k2, V1 v2, K1 k3, V1 v3)
    • of

      public static <K1, V1> ExpandableMap<K1,V1> of(K1 k1, V1 v1, K1 k2, V1 v2, K1 k3, V1 v3, K1 k4, V1 v4)
    • of

      public static <K1, V1> ExpandableMap<K1,V1> of(K1 k1, V1 v1, K1 k2, V1 v2, K1 k3, V1 v3, K1 k4, V1 v4, K1 k5, V1 v5)
    • of

      public static <K1, V1> ExpandableMap<K1,V1> of(K1 k1, V1 v1, K1 k2, V1 v2, K1 k3, V1 v3, K1 k4, V1 v4, K1 k5, V1 v5, K1 k6, V1 v6)
    • of

      public static <K1, V1> ExpandableMap<K1,V1> of(K1 k1, V1 v1, K1 k2, V1 v2, K1 k3, V1 v3, K1 k4, V1 v4, K1 k5, V1 v5, K1 k6, V1 v6, K1 k7, V1 v7)
    • of

      public static <K1, V1> ExpandableMap<K1,V1> of(K1 k1, V1 v1, K1 k2, V1 v2, K1 k3, V1 v3, K1 k4, V1 v4, K1 k5, V1 v5, K1 k6, V1 v6, K1 k7, V1 v7, K1 k8, V1 v8)
    • of

      public static <K1, V1> ExpandableMap<K1,V1> of(K1 k1, V1 v1, K1 k2, V1 v2, K1 k3, V1 v3, K1 k4, V1 v4, K1 k5, V1 v5, K1 k6, V1 v6, K1 k7, V1 v7, K1 k8, V1 v8, K1 k9, V1 v9)
    • of

      public static <K1, V1> ExpandableMap<K1,V1> of(K1 k1, V1 v1, K1 k2, V1 v2, K1 k3, V1 v3, K1 k4, V1 v4, K1 k5, V1 v5, K1 k6, V1 v6, K1 k7, V1 v7, K1 k8, V1 v8, K1 k9, V1 v9, K1 k10, V1 v10)
    • ofEntries

      @SafeVarargs public static <K1, V1> ExpandableMap<K1,V1> ofEntries(Map.Entry<? extends K1,? extends V1>... entries)
    • with

      public ExpandableMap<K,V> with(K key, V value, Object... more)
    • size

      public int size()
      Specified by:
      size in interface Map<K,V>
      Overrides:
      size in class AbstractMap<K,V>
    • values

      public Collection<V> values()
      Specified by:
      values in interface Map<K,V>
      Overrides:
      values in class AbstractMap<K,V>