Package de.intarsys.tools.collection
Class MapTools
- java.lang.Object
-
- de.intarsys.tools.collection.MapTools
-
public class MapTools extends java.lang.ObjectA tool class for Map extensions.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSEPARATOR
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.MapdefineEntries(java.util.Map map, java.util.List declarations)Define new entries inmapfrom all declaration strings indeclarations.static java.util.MapdefineEntry(java.util.Map map, java.lang.String declaration)Define a new entry in themapfromdefinition.static java.lang.Objectget(java.util.Map map, java.lang.Object key, java.lang.Object defaultValue)static java.lang.Stringget(java.util.Map map, java.lang.Object key, java.lang.String defaultValue)
-
-
-
Field Detail
-
SEPARATOR
public static final java.lang.String SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
defineEntries
public static java.util.Map defineEntries(java.util.Map map, java.util.List declarations)Define new entries inmapfrom all declaration strings indeclarations. 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 java.util.Map defineEntry(java.util.Map map, java.lang.String declaration)Define a new entry in themapfromdefinition.definitioncontains 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 java.lang.Object get(java.util.Map map, java.lang.Object key, java.lang.Object defaultValue)
-
get
public static java.lang.String get(java.util.Map map, java.lang.Object key, java.lang.String defaultValue)
-
-