Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BSMConfigHelper

        public BSMConfigHelper()
    • 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 used
        key - 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 use
        key - the key
        defaultValue - 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 used
        key - the key
        defaultValue - 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