de.intarsys.tools.collection
Class MapTools
java.lang.Object
de.intarsys.tools.collection.MapTools
public class MapTools
- extends Object
A tool class for Map extensions.
|
Method Summary |
static Map<Object,Object> |
defineEntries(Map<Object,Object> map,
List<String> declarations)
Define new entries in map from all declaration strings in
declarations. |
static Map |
defineEntry(Map map,
String declaration)
Define a new entry in the map from definition. |
static Object |
get(Map map,
Object key,
Object defaultValue)
|
static String |
get(Map map,
Object key,
String defaultValue)
|
static void |
toMapDeep(Map<Object,Object> map,
String prefix,
Map<String,Object> result)
|
SEPARATOR
public static final String SEPARATOR
- See Also:
- Constant Field Values
defineEntries
public static Map<Object,Object> defineEntries(Map<Object,Object> map,
List<String> declarations)
- Define new entries in
map from all declaration strings in
declarations. For every string in the collection,
defineEntry(Map, String) is called.
- Parameters:
map - The map to receive the new declarationsdeclarations - A collection of declaration strings.
- Returns:
- The parameter
map
defineEntry
public static Map defineEntry(Map map,
String declaration)
- Define a new entry in the
map from definition.
definition contains a string in the form "key=value". A
entry is defined in the map with "key" as the entries key and the trimmed
"value" as its value. If no "=" is available, the value will be an empty
string.
- Parameters:
map - The map where we will put the key/value pair.declaration - The string representation of the key/value pair.
- Returns:
- The parameter
map
get
public static Object get(Map map,
Object key,
Object defaultValue)
get
public static String get(Map map,
Object key,
String defaultValue)
toMapDeep
public static void toMapDeep(Map<Object,Object> map,
String prefix,
Map<String,Object> result)
Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.