public class MapUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <K,V> MapBuilder<K,V> |
builder() |
static <K,V> MapBuilder<K,V> |
builder(java.util.Map<K,V> initialMap) |
static java.util.Properties |
mapToProperties(java.util.Map<?,?> map)
Convert a generic map to a Properties object.
|
static <V> java.util.Map<java.lang.String,V> |
objectToStringMap(java.util.Map<java.lang.Object,V> map)
Filter a map with Object keys.
|
static <V> java.util.Map<java.lang.String,V> |
prefixItems(java.util.Map<java.lang.String,V> map,
java.lang.String prefix)
Apply a given prefix to all String keys in a map.
|
static <K,V> java.util.Map<K,V> |
put(java.util.Map<K,V> source,
K key,
V value) |
static <K,V> java.util.Map<K,V> |
putAllIfAbsent(java.util.Map<K,V> target,
java.util.Map<? extends K,? extends V> source) |
static <K,V> java.util.Map<K,V> |
putIfAbsent(java.util.Map<K,V> target,
K key,
V value) |
static <V> java.util.Map<java.lang.Object,V> |
stringMapToObjectMap(java.util.Map<java.lang.String,V> map)
Convert a map with String keys to a generic map with Object keys.
|
static <K> java.lang.String |
stringValue(java.util.Map<K,?> map,
K key)
Return the String value of given key from a given map.
|
static <K> java.lang.String |
stringValue(java.util.Map<K,?> map,
K key,
java.lang.String defaultValue)
Return the String value of given key from a given map.
|
static <K> java.util.Map<K,java.lang.String> |
stringValues(java.util.Map<K,?> map)
Convert a map with any type of values to a map with only String values.
|
static <V> java.util.Map<java.lang.String,V> |
unprefixItems(java.util.Map<java.lang.String,V> map,
java.lang.String prefix) |
public static <K,V> MapBuilder<K,V> builder()
public static <K,V> MapBuilder<K,V> builder(java.util.Map<K,V> initialMap)
public static <V> java.util.Map<java.lang.String,V> objectToStringMap(java.util.Map<java.lang.Object,V> map)
V - the value type of the mapmap - the input map with Object keyspublic static <V> java.util.Map<java.lang.Object,V> stringMapToObjectMap(java.util.Map<java.lang.String,V> map)
V - the value type of the mapmap - the input map with String keyspublic static java.util.Properties mapToProperties(java.util.Map<?,?> map)
map - the input mappublic static <V> java.util.Map<java.lang.String,V> prefixItems(java.util.Map<java.lang.String,V> map,
java.lang.String prefix)
V - the value type of the mapmap - the input map with String keysprefix - the prefix to apply to every keypublic static <V> java.util.Map<java.lang.String,V> unprefixItems(java.util.Map<java.lang.String,V> map,
java.lang.String prefix)
public static <K> java.util.Map<K,java.lang.String> stringValues(java.util.Map<K,?> map)
K - the key type of the mapmap - the input map with any type of valuespublic static <K> java.lang.String stringValue(java.util.Map<K,?> map,
K key)
K - the key type of the mapmap - the input map with given keykey - the key to look uppublic static <K> java.lang.String stringValue(java.util.Map<K,?> map,
K key,
java.lang.String defaultValue)
K - the key type of the mapmap - the input map with given keykey - the key to look updefaultValue - the default value to return if no String value found for given keypublic static <K,V> java.util.Map<K,V> putIfAbsent(java.util.Map<K,V> target,
K key,
V value)
public static <K,V> java.util.Map<K,V> putAllIfAbsent(java.util.Map<K,V> target,
java.util.Map<? extends K,? extends V> source)
public static <K,V> java.util.Map<K,V> put(java.util.Map<K,V> source,
K key,
V value)
Copyright © 2020 Axual B.V.. All rights reserved.