| Modifier and Type | Method and Description |
|---|---|
static <K,V> HashMap<K,V> |
copyHashMap(HashMap<K,V> map)
Returns copied HashMap.
|
static <K,V> LinkedHashMap<K,V> |
copyLinkedHashMap(LinkedHashMap<K,V> map)
Returns copied LinkedHashMap.
|
static <K,V> HashMap<K,V> |
copyMap(Map<K,V> map)
Returns copied Map.
|
static boolean |
isEmpty(Map map)
Returns whether specified
Map is empty or not. |
static <K,V> HashMap<K,V> |
merge(Map<K,V>... maps)
Merges specified maps into one new map and returns it.
|
static <K,V> HashMap<K,V> |
newHashMap(K key,
V value)
Returns newly created HashMap with the specified key and value pair added.
|
static <K,V> HashMap<K,V> |
newHashMap(Map<K,V> data)
Returns newly created HashMap with the specified map data.
|
static <K,V> HashMap<K,V> |
newHashMap(Object... objects)
Returns newly created HashMap with the specified key and value pairs added.
|
static <K,V> LinkedHashMap<K,V> |
newLinkedHashMap(K key,
V value)
Returns newly created LinkedHashMap with the specified key and value pair added.
|
static <K,V> LinkedHashMap<K,V> |
newLinkedHashMap(Object... objects)
Returns newly created LinkedHashMap with the specified key and value pairs added.
|
static <K,V> Map<K,V> |
nonNull(Map<K,V> map)
|
static boolean |
notEmpty(Map map)
Returns whether specified
Map is empty or not. |
static <K,V> void |
removeAllValues(Map<K,V> map,
V value)
Removes all map entries where value is the same as the specified one.
|
public static boolean isEmpty(@Nullable Map map)
Map is empty or not.public static boolean notEmpty(@Nullable Map map)
Map is empty or not.@NotNull public static <K,V> HashMap<K,V> copyMap(@NotNull Map<K,V> map)
K - map key typeV - map value typemap - map to copy@NotNull public static <K,V> HashMap<K,V> copyHashMap(@NotNull HashMap<K,V> map)
K - HashMap key typeV - HashMap value typemap - HashMap to copy@NotNull public static <K,V> LinkedHashMap<K,V> copyLinkedHashMap(@NotNull LinkedHashMap<K,V> map)
K - LinkedHashMap key typeV - LinkedHashMap value typemap - LinkedHashMap to copy@NotNull public static <K,V> HashMap<K,V> newHashMap(@NotNull Map<K,V> data)
K - key typeV - value typedata - data map@NotNull public static <K,V> HashMap<K,V> newHashMap(@Nullable K key, @Nullable V value)
K - key typeV - value typekey - key to addvalue - value to add@NotNull public static <K,V> HashMap<K,V> newHashMap(@Nullable Object... objects)
K - key typeV - value typeobjects - mixed keys and values@NotNull public static <K,V> LinkedHashMap<K,V> newLinkedHashMap(@Nullable K key, @Nullable V value)
K - key typeV - value typekey - key to addvalue - value to add@NotNull public static <K,V> LinkedHashMap<K,V> newLinkedHashMap(@Nullable Object... objects)
K - key typeV - value typeobjects - key-value pairspublic static <K,V> void removeAllValues(@NotNull Map<K,V> map, @Nullable V value)
K - key typeV - value typemap - map to remove entries fromvalue - value for which entries should be removedCopyright © 2020. All rights reserved.