Class BSMConfigHelper
- java.lang.Object
-
- org.opennms.features.vaadin.dashboard.dashlets.BSMConfigHelper
-
public class BSMConfigHelper extends 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(Map<String,String> map)
Created as business service search criteria for a given map.static boolean
getBooleanForKey(Map<String,String> map, 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(Map<String,String> map, String key, int defaultValue)
Returns the int value for a given key.static String
getStringForKey(Map<String,String> map, String key, String defaultValue)
Returns the string value for a given key.
-
-
-
Method Detail
-
getBooleanForKey
public static boolean getBooleanForKey(Map<String,String> map, 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 String getStringForKey(Map<String,String> map, String key, 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(Map<String,String> map, 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(Map<String,String> map)
Created as business service search criteria for a given map.- Parameters:
map
- the map to inverstigate- Returns:
- the criteria
-
-