Package org.opennms.core.utils
Class ParameterMap
- java.lang.Object
-
- org.opennms.core.utils.ParameterMap
-
public abstract class ParameterMap extends Object
Convenience class for looking up string and integer values in a parameter map.
-
-
Constructor Summary
Constructors Constructor Description ParameterMap()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Integer
getIntValue(String key, Object value, Integer defaultValue)
static boolean
getKeyedBoolean(Map map, String key, boolean defValue)
This method is used to lookup a specific key in the map.static int
getKeyedDecodedInteger(Map map, String key, int defValue)
This method is used to lookup a specific key in the map.static long
getKeyedDecodedLong(Map map, String key, long defValue)
This method is used to lookup a specific key in the map.static int
getKeyedInteger(Map map, String key, int defValue)
This method is used to lookup a specific key in the map.static int[]
getKeyedIntegerArray(Map map, String key, int[] defValues)
This method is used to lookup a specific key in the map.static long
getKeyedLong(Map map, String key, long defValue)
This method is used to lookup a specific key in the map.static long
getKeyedLongImmutable(Map map, String key, long defValue)
Same as getKeyedLong, but does not mutate the mapstatic String
getKeyedString(Map map, String key, String defValue)
This method is used to lookup a specific key in the map.static <T> T
getKeyedValue(Map<String,T> map, String key, T defValue)
This method is used to lookup a specific key in the map.static Long
getLongValue(String key, Object value, Long defaultValue)
-
-
-
Method Detail
-
getKeyedLong
public static long getKeyedLong(Map map, String key, long defValue)
This method is used to lookup a specific key in the map. If the mapped value is a string it is converted to a long and the original string value is replaced in the map. The converted value is returned to the caller. If the value cannot be converted then the default value is stored in the map. If the specified key does not exist in the map then the default value is returned.
-
getKeyedLongImmutable
public static long getKeyedLongImmutable(Map map, String key, long defValue)
Same as getKeyedLong, but does not mutate the map
-
getKeyedDecodedLong
public static long getKeyedDecodedLong(Map map, String key, long defValue)
This method is used to lookup a specific key in the map. If the mapped value is a string it is converted to a long and the original string value is replaced in the map. The converted value is returned to the caller. If the value cannot be converted then the default value is stored in the map. If the specified key does not exist in the map then the default value is returned.
-
getKeyedInteger
public static int getKeyedInteger(Map map, String key, int defValue)
This method is used to lookup a specific key in the map. If the mapped value is a string it is converted to an integer and the original string value is replaced in the map. The converted value is returned to the caller. If the value cannot be converted then the default value is stored in the map. If the specified key does not exist in the map then the default value is returned.
-
getKeyedIntegerArray
public static final int[] getKeyedIntegerArray(Map map, String key, int[] defValues)
This method is used to lookup a specific key in the map. If the mapped value is a string is is converted to an integer and the original string value is replaced in the map. The converted value is returned to the caller. If the value cannot be converted then the default value is used.
-
getKeyedDecodedInteger
public static int getKeyedDecodedInteger(Map map, String key, int defValue)
This method is used to lookup a specific key in the map. If the mapped value is a string it is converted to an integer and the original string value is replaced in the map. The converted value is returned to the caller. If the value cannot be converted then the default value is stored in the map. If the specified key does not exist in the map then the default value is returned.
-
getKeyedString
public static String getKeyedString(Map map, String key, String defValue)
This method is used to lookup a specific key in the map. If the mapped value is not a String it is converted to a String and the original value is replaced in the map. The converted value is returned to the caller. If the specified key does not exist in the map then the default value is returned.
-
getKeyedBoolean
public static boolean getKeyedBoolean(Map map, String key, boolean defValue)
This method is used to lookup a specific key in the map. If the mapped value is a string it is converted to a boolean and the original string value is replaced in the map. The converted value is returned to the caller. If the value cannot be converted then the default value is stored in the map. If the specified key does not exist in the map then the default value is returned.
-
getKeyedValue
public static <T> T getKeyedValue(Map<String,T> map, String key, T defValue)
This method is used to lookup a specific key in the map. If the value cannot be found in the map then the default value is stored in the map. If the specified key does not exist in the map then the default value is returned.
-
-