Class AttributeValues


  • public class AttributeValues
    extends Object
    This class provides utilities for process attribute values. The attribute values are passed into the CLI via properties file.
    • Method Detail

      • parse

        public static Map<String,​Set<String>> parse​(CommandManager mgr,
                                                          String fileName,
                                                          List listAttributeValues)
                                                   throws CLIException
        Returns a map of attribute name to set of values.
        Parameters:
        mgr - Command Manager object.
        fileName - Name of file that contains the attribute values data.
        listAttributeValues - list of attribute values in the format. <attribute-name>=<attribute-value>.
        Returns:
        service attribute values.
        Throws:
        CLIException - if the file contains data of incorrect format.
      • parse

        public static Map<String,​Set<String>> parse​(CommandManager mgr,
                                                          List listAttributeValues)
                                                   throws CLIException
        Returns a map of attribute name to set of values.
        Parameters:
        mgr - Command Manager object.
        listAttributeValues - list of attribute values in the format. <attribute-name>=<attribute-value>.
        Returns:
        service attribute values.
        Throws:
        CLIException - if the file contains data of incorrect format.
      • parse

        public static Map<String,​Set<String>> parse​(CommandManager mgr,
                                                          String fileName)
                                                   throws CLIException
        Returns a map of attribute name to set of values.
        Parameters:
        mgr - Command Manager object.
        fileName - Name of file that contains the attribute values data.
        Returns:
        service attribute values.
        Throws:
        CLIException - if the file contains data of incorrect format.
      • parseValues

        public static List parseValues​(String fileName)
                                throws CLIException
        Returns a set of values.
        Parameters:
        fileName - Name of file that contains the values data.
        Returns:
        values.
        Throws:
        CLIException - if the file contains data of incorrect format.
      • mergeAttributeValues

        public static boolean mergeAttributeValues​(Map map1,
                                                   Map map2,
                                                   Map<String,​Boolean> multipleAttributesMap,
                                                   boolean bAdd)
        Merage two attribute values map.
        Parameters:
        map1 - Map of String of Set of String.
        map2 - Map of String of Set of String.
        multipleAttributesMap - map of attribute name to true if the attribute type is multiple.
        bAdd - true to add the values of map2 map1. false to remove values of map2 from map1.
        Returns:
        truemap1 is altered.
      • mergeAttributeValues

        public static boolean mergeAttributeValues​(Map map1,
                                                   Map map2,
                                                   boolean bAdd)
        Merage two attribute values map.
        Parameters:
        map1 - Map of String of Set of String.
        map2 - Map of String of Set of String.
        bAdd - true to add the values of map2 map1. false to remove values of map2 from map1.
        Returns:
        truemap1 is altered.