Class BSMConfigHelper
- java.lang.Object
-
- org.opennms.features.vaadin.dashboard.dashlets.BSMConfigHelper
-
public class BSMConfigHelper extends java.lang.Object
Small helper class for loading search criteria from the dashlet's parameter map.- Author:
- Christian Pape
-
-
Constructor Summary
Constructors Constructor Description BSMConfigHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BusinessServiceSearchCriteria
fromMap(java.util.Map<java.lang.String,java.lang.String> map)
Created as business service search criteria for a given map.static boolean
getBooleanForKey(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String key)
Returns a boolean value for a given key from the map where "1", "true", "yes" and "on" are interpeted as boolean true, otherwise false.static int
getIntForKey(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String key, int defaultValue)
Returns the int value for a given key.static java.lang.String
getStringForKey(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String key, java.lang.String defaultValue)
Returns the string value for a given key.
-
-
-
Method Detail
-
getBooleanForKey
public static boolean getBooleanForKey(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String key)
Returns a boolean value for a given key from the map where "1", "true", "yes" and "on" are interpeted as boolean true, otherwise false.- Parameters:
map
- the map to be usedkey
- the key- Returns:
- the boolean value
-
getStringForKey
public static java.lang.String getStringForKey(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String key, java.lang.String defaultValue)
Returns the string value for a given key. Null values will be returned as empty strings.- Parameters:
map
- the map to usekey
- the keydefaultValue
- default value- Returns:
- the string value, defaultValue if Null or empty
-
getIntForKey
public static int getIntForKey(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String key, int defaultValue)
Returns the int value for a given key. Unparsable values are returned as zero.- Parameters:
map
- the map to be usedkey
- the keydefaultValue
- default value- Returns:
- the int value, defaultValue if not parsable
-
fromMap
public static BusinessServiceSearchCriteria fromMap(java.util.Map<java.lang.String,java.lang.String> map)
Created as business service search criteria for a given map.- Parameters:
map
- the map to inverstigate- Returns:
- the criteria
-
-