Class StringOption

    • Constructor Detail

      • StringOption

        protected StringOption​(OptionManager owner,
                               String commandline,
                               String property,
                               Object defValue,
                               UserMode minUserMode)
        Initializes the option. Will always output the default value.
        Parameters:
        owner - the owner of this option
        commandline - the commandline string to identify the option (no leading dash)
        property - the name of bean property
        defValue - the default value, if null then the owner's current state is used
        minUserMode - the minimum user mode before showing this option
      • StringOption

        protected StringOption​(OptionManager owner,
                               String commandline,
                               String property,
                               Object defValue,
                               boolean outputDefValue,
                               UserMode minUserMode)
        Initializes the option.
        Parameters:
        owner - the owner of this option
        commandline - the commandline string to identify the option (no leading dash)
        property - the name of bean property
        defValue - the default value, if null then the owner's current state is used
        outputDefValue - whether to output the default value or not
        minUserMode - the minimum user mode before showing this option
    • Method Detail

      • compareValues

        protected boolean compareValues​(Object value,
                                        Object defValue)
        Compares the two values.
        Specified by:
        compareValues in class AbstractArgumentOption
        Parameters:
        value - the value to compare against the default value
        defValue - the default value to compare against
        Returns:
        true if both are equal
      • isParseable

        protected boolean isParseable​(String s)
        Allows additional checks whether to include that particular string represents a valid option, i.e., is parseable.

        Any string is valid, even empty ones.
        Parameters:
        s - the option string to test.
        Returns:
        always true
      • toString

        public String toString​(Object obj)
        Returns a string representation of the specified object.
        Specified by:
        toString in class AbstractArgumentOption
        Parameters:
        obj - the object to turn into a string
        Returns:
        the string representation