Class BSMConfigHelper


  • public class BSMConfigHelper
    extends Object
    Small helper class for loading search criteria from the dashlet's parameter map.
    Author:
    Christian Pape
    • Constructor Detail

      • BSMConfigHelper

        public BSMConfigHelper()
    • 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 used
        key - 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 use
        key - the key
        defaultValue - 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 used
        key - the key
        defaultValue - default value
        Returns:
        the int value, defaultValue if not parsable