Class AbstractOption

    • Field Detail

      • illegalNameCharacters

        public static final char[] illegalNameCharacters
        Array of characters not valid to use in option names.
      • name

        protected String name
        Name of this option.
      • cliChar

        protected char cliChar
        Command line interface text of this option.
      • purpose

        protected String purpose
        Text of the purpose of this option.
    • Constructor Detail

      • AbstractOption

        public AbstractOption​(String name,
                              char cliChar,
                              String purpose)
        Creates a new instance of an abstract option given its class name, command line interface text and its purpose.
        Parameters:
        name - the name of this option
        cliChar - the command line interface text
        purpose - the text describing the purpose of this option
    • Method Detail

      • nameIsLegal

        public static boolean nameIsLegal​(String optionName)
        Gets whether the name is valid or not.
        Parameters:
        optionName - the name of the option
        Returns:
        true if the name that not contain any illegal character
      • getName

        public String getName()
        Description copied from interface: Option
        Gets the name of this option
        Specified by:
        getName in interface Option
        Returns:
        the name of this option
      • getCLIChar

        public char getCLIChar()
        Description copied from interface: Option
        Gets the Command Line Interface text of this option
        Specified by:
        getCLIChar in interface Option
        Returns:
        the Command Line Interface text
      • getPurpose

        public String getPurpose()
        Description copied from interface: Option
        Gets the purpose of this option
        Specified by:
        getPurpose in interface Option
        Returns:
        the purpose of this option
      • resetToDefault

        public void resetToDefault()
        Description copied from interface: Option
        Resets this option to the default value
        Specified by:
        resetToDefault in interface Option
      • getStateString

        public String getStateString()
        Description copied from interface: Option
        Gets the state of this option in human readable form
        Specified by:
        getStateString in interface Option
        Returns:
        the string with state of this option in human readable form
      • copy

        public Option copy()
        Description copied from interface: Option
        Gets a copy of this option
        Specified by:
        copy in interface Option
        Returns:
        the copy of this option