Class ParameterMap


  • public abstract class ParameterMap
    extends Object
    Convenience class for looking up string and integer values in a parameter map.
    • Constructor Detail

      • ParameterMap

        public ParameterMap()
    • 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.
        Parameters:
        map - a Map object.
        key - a String object.
        defValue - a long.
        Returns:
        The long value associated with the key.
      • 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.
        Parameters:
        map - a Map object.
        key - a String object.
        defValue - a long.
        Returns:
        The long value associated with the key.
      • 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.
        Parameters:
        map - a Map object.
        key - a String object.
        defValue - a int.
        Returns:
        The int value associated with the key.
      • 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.
        Parameters:
        map - a Map object.
        key - a String object.
        defValues - an array of int.
        Returns:
        The array of integer values associated with the key.
      • 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.
        Parameters:
        map - a Map object.
        key - a String object.
        defValue - a int.
        Returns:
        The int value associated with the key.
      • 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.
        Parameters:
        map - a Map object.
        key - a String object.
        defValue - a String object.
        Returns:
        The String value associated with the key.
      • 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.
        Parameters:
        map - a Map object.
        key - a String object.
        defValue - a boolean.
        Returns:
        The bool value associated with the key.
      • 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.