Class MapUtils


  • public class MapUtils
    extends Object
    • Constructor Detail

      • MapUtils

        public MapUtils()
    • Method Detail

      • getFirstString

        public static String getFirstString​(Map<String,​String[]> map,
                                            Object key,
                                            String defaultValue)
        Gets a value for a given key, or a default value if the key is not found. Will return the first entry in the String array.
        Parameters:
        map -
        key -
        defaultValue -
        Returns:
      • getFirstString

        public static String getFirstString​(com.google.common.collect.ListMultimap<String,​String> map,
                                            String key,
                                            String defaultValue)
      • putAsStringArrayIfNotNull

        public static void putAsStringArrayIfNotNull​(Map<String,​String[]> out,
                                                     String key,
                                                     String data)
        Put a String value in a map, transforming it into a 1-slot String array, and only if it's not null.
        Parameters:
        out -
        key -
        data -
      • putIfNotNull

        public static void putIfNotNull​(com.google.common.collect.ListMultimap<String,​String> out,
                                        String key,
                                        String data)
      • convertMapList

        public static Map<String,​List<String>> convertMapList​(Map<String,​String[]> map)
        Converts a Map<String, String[]> into a Map<String, List<<String>>
        Parameters:
        map - Map to convert
        Returns:
        Converted Map