Class OptionsGroup

    • Constructor Detail

      • OptionsGroup

        public OptionsGroup​(String name)
        Creates new named OptionsGroup.
        Parameters:
        name - the name of the group
      • OptionsGroup

        public OptionsGroup​(String name,
                            Collection<String> options)
        Creates new named OptionsGroup with a set of option definitions.
        Parameters:
        name - the name of the group
        options - names of properties in the syntax mentioned in OptionsGroup
    • Method Detail

      • addOption

        public void addOption​(String option)
        Adds a option definition to this group. The option syntax can be "propertyName" to denote required property and "!propertyName" to denote required absence of a property.
        Parameters:
        option - definition.
      • getName

        public String getName()
        The name of the group.
      • getOptions

        public Set<String> getOptions()
        The option definitions in this group.
      • option

        public OptionsGroup option​(String option)
        Adds a option definition to this group. The option syntax can be "propertyName" to denote required property and "!propertyName" to denote required absence of a property.
        Parameters:
        option - definition.
      • options

        public OptionsGroup options​(String... options)
        Adds a number of option definitions to this group. The option syntax can be "propertyName" to denote required property and "!propertyName" to denote required absence of a property.
        Parameters:
        options - options definition
      • withName

        public static OptionsGroup withName​(String name)
        Creates new group with the specified name.
        Parameters:
        name - the name of the group
      • withName

        public static OptionsGroup withName​(Enum<?> enumItem)
        Creates new group with the specified name of the given Enum name.
        Parameters:
        enumItem - the name of the group
        See Also:
        Enum.name()
      • withNameAndOptions

        public static OptionsGroup withNameAndOptions​(String name,
                                                      String... options)
        Creates new group with the specified name and option definitions.
        Parameters:
        name - the name of the group
        options - options definition