Package de.umass.util
Class MapUtilities
java.lang.Object
de.umass.util.MapUtilities
Utility class to perform various operations on Maps.
- Author:
- Adrian Woodhead
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
nullSafePut
(Map<String, String> map, String key, int value) Puts the passed key and value into the map only if the value is not -1.static void
Puts the passed key and value into the map only if the value is not null.static void
Puts the passed key and value into the map only if the value is not null.
-
Method Details
-
nullSafePut
Puts the passed key and value into the map only if the value is not null.- Parameters:
map
- Map to add key and value to.key
- Map key.value
- Map value, if null will not be added to map.
-
nullSafePut
Puts the passed key and value into the map only if the value is not null.- Parameters:
map
- Map to add key and value to.key
- Map key.value
- Map value, if null will not be added to map.
-
nullSafePut
Puts the passed key and value into the map only if the value is not -1.- Parameters:
map
- Map to add key and value to.key
- Map key.value
- Map value, if -1 will not be added to map.
-