Class MapHelper


  • public final class MapHelper
    extends Object
    Utility class for operations on Maps.
    • Method Detail

      • readMap

        public static Map<String,​Set<String>> readMap​(String fileName)
                                                     throws IOException
        Read a properties file into a map of strings to sets of strings. Lines whose first non whitespace character is a hash are ignored as comments, while lines which do not contain an assignment are just ignored.
        Parameters:
        fileName - The property file name
        Returns:
        A map of strings to sets of strings
        Throws:
        IOException - if there is an IO problem when reading the file (like it doesn't exist, etc.)
      • readMap

        public static Map<String,​Set<String>> readMap​(InputStream is)
                                                     throws IOException
        Read a stream into a map of strings to sets of strings. Lines whose first non whitespace character is a hash are ignored as comments, while lines which do not contain an assignment are just ignored.
        Parameters:
        is - A stream to read properties from.
        Returns:
        A map of strings to sets of strings
        Throws:
        IOException - if there is an IO problem when reading the file (like it doesn't exist, etc.)