de.intarsys.tools.collection
public class MapTools extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SEPARATOR |
Modifier and Type | Method and Description |
---|---|
static java.util.Map |
defineEntries(java.util.Map map,
java.util.List declarations)
Define new entries in
map from all declaration strings in
declarations . |
static java.util.Map |
defineEntry(java.util.Map map,
java.lang.String declaration)
Define a new entry in the
map from definition . |
static java.lang.Object |
get(java.util.Map map,
java.lang.Object key,
java.lang.Object defaultValue) |
static java.lang.String |
get(java.util.Map map,
java.lang.Object key,
java.lang.String defaultValue) |
public static final java.lang.String SEPARATOR
public static java.util.Map defineEntries(java.util.Map map, java.util.List declarations)
map
from all declaration strings in
declarations
. For every string in the collection, defineEntry(Map, String)
is called.map
- The map to receive the new declarationsdeclarations
- A collection of declaration strings.map
public static java.util.Map defineEntry(java.util.Map map, java.lang.String declaration)
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.map
- The map where we will put the key/value pair.declaration
- The string representation of the key/value pair.map
public static java.lang.Object get(java.util.Map map, java.lang.Object key, java.lang.Object defaultValue)
public static java.lang.String get(java.util.Map map, java.lang.Object key, java.lang.String defaultValue)