java.lang.Object
org.jhotdraw8.icollection.MapEntries
Provides factory methods for creating a list of
Map.Entrys.-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> Map.Entry <K, V> entry(K k, V v) Creates a new map entry.static <K,V> LinkedHashMap <K, V> linkedHashMap(List<? extends Map.Entry<? extends K, ? extends V>> l) Creates a new linked hash map from a list of entries.static <K,V, M extends Map<K, V>>
MCreates a new map from a list of entries.of()Returns a list containing 0 map entries.of(K k1, V v1) Returns a list containing 1 map entry.of(K k1, V v1, K k2, V v2) Returns a list containing 2 map entries.of(K k1, V v1, K k2, V v2, K k3, V v3) Returns a list containing 3 map entries.of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) Returns a list containing 4 map entries.of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) Returns a list containing 5 map entries.of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) Returns a list containing 6 map entries.of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) Returns a list containing 7 map entries.of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8) Returns a list containing 8 map entries.of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9) Returns a list containing 9 map entries.of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10) Returns a list containing 10 map entries.Returns a list containing the specified map entries.
-
Method Details
-
of
Returns a list containing 0 map entries.Keys and values can be null.
- Returns:
- a list containing the entries
-
of
Returns a list containing 1 map entry.Key and value can be null.
- Type Parameters:
K- the key typeV- the value type- Parameters:
k1- key 1v1- value 1- Returns:
- a list containing the entries
-
of
Returns a list containing 2 map entries.Keys and values can be null.
- Type Parameters:
K- the key typeV- the value type- Parameters:
k1- key 1v1- value 1k2- key 2v2- value 2- Returns:
- a list containing the entries
-
of
Returns a list containing 3 map entries.Keys and values can be null.
- Type Parameters:
K- the key typeV- the value type- Parameters:
k1- key 1v1- value 1k2- key 2v2- value 2k3- key 3v3- value 3- Returns:
- a list containing the entries
-
of
Returns a list containing 4 map entries.Keys and values can be null.
- Type Parameters:
K- the key typeV- the value type- Parameters:
k1- key 1v1- value 1k2- key 2v2- value 2k3- key 3v3- value 3k4- key 4v4- value 4- Returns:
- a list containing the entries
-
of
public static <K,V> List<Map.Entry<K,V>> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) Returns a list containing 5 map entries.Keys and values can be null.
- Type Parameters:
K- the key typeV- the value type- Parameters:
k1- key 1v1- value 1k2- key 2v2- value 2k3- key 3v3- value 3k4- key 4v4- value 4k5- key 5v5- value 5- Returns:
- a list containing the entries
-
of
public static <K,V> List<Map.Entry<K,V>> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) Returns a list containing 6 map entries.Keys and values can be null.
- Type Parameters:
K- the key typeV- the value type- Parameters:
k1- key 1v1- value 1k2- key 2v2- value 2k3- key 3v3- value 3k4- key 4v4- value 4k5- key 5v5- value 5k6- key 6v6- value 6- Returns:
- a list containing the entries
-
of
public static <K,V> List<Map.Entry<K,V>> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) Returns a list containing 7 map entries.Keys and values can be null.
- Type Parameters:
K- the key typeV- the value type- Parameters:
k1- key 1v1- value 1k2- key 2v2- value 2k3- key 3v3- value 3k4- key 4v4- value 4k5- key 5v5- value 5k6- key 6v6- value 6k7- key 7v7- value 7- Returns:
- a list containing the entries
-
of
public static <K,V> List<Map.Entry<K,V>> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8) Returns a list containing 8 map entries.Keys and values can be null.
- Type Parameters:
K- the key typeV- the value type- Parameters:
k1- key 1v1- value 1k2- key 2v2- value 2k3- key 3v3- value 3k4- key 4v4- value 4k5- key 5v5- value 5k6- key 6v6- value 6k7- key 7v7- value 7k8- key 8v8- value 8- Returns:
- a list containing the entries
-
of
public static <K,V> List<Map.Entry<K,V>> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9) Returns a list containing 9 map entries.Keys and values can be null.
- Type Parameters:
K- the key typeV- the value type- Parameters:
k1- key 1v1- value 1k2- key 2v2- value 2k3- key 3v3- value 3k4- key 4v4- value 4k5- key 5v5- value 5k6- key 6v6- value 6k7- key 7v7- value 7k8- key 8v8- value 8k9- key 9v9- value 9- Returns:
- a list containing the entries
-
of
public static <K,V> List<Map.Entry<K,V>> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10) Returns a list containing 10 map entries.Keys and values can be null.
- Type Parameters:
K- the key typeV- the value type- Parameters:
k1- key 1v1- value 1k2- key 2v2- value 2k3- key 3v3- value 3k4- key 4v4- value 4k5- key 5v5- value 5k6- key 6v6- value 6k7- key 7v7- value 7k8- key 8v8- value 8k9- key 9v9- value 9k10- key 10v10- value 10- Returns:
- a list containing the entries
-
ofEntries
@SafeVarargs public static <K,V> List<Map.Entry<K,V>> ofEntries(Map.Entry<? extends K, ? extends V>... entries) Returns a list containing the specified map entries.Keys and values can be null.
- Type Parameters:
K- the key typeV- the value type- Parameters:
entries- the entries- Returns:
- a list containing the entries
-
linkedHashMap
public static <K,V> LinkedHashMap<K,V> linkedHashMap(List<? extends Map.Entry<? extends K, ? extends V>> l) Creates a new linked hash map from a list of entries.- Type Parameters:
K- the key typeV- the value type- Parameters:
l- a list of entries- Returns:
- a new linked hash map
-
map
public static <K,V, M mapM extends Map<K, V>> (Supplier<M> factory, List<? extends Map.Entry<? extends K, ? extends V>> l) Creates a new map from a list of entries.- Type Parameters:
K- the key typeV- the value type- Parameters:
l- a list of entries- Returns:
- a new linked hash map
-
entry
Creates a new map entry.Key and value can be null.
- Type Parameters:
K- the key typeV- the value type- Parameters:
k- the keyv- the value- Returns:
- a new map entry
-