Package joptsimple

Class AbstractOptionSpec<V>

    • Method Detail

      • values

        public final List<V> values​(OptionSet detectedOptions)
        Description copied from interface: OptionSpec
        Gives any arguments associated with the given option in the given set of detected options.

        Specifying a default argument value for this option will cause this method to return that default value even if this option was not detected on the command line, or if this option can take an optional argument but did not have one on the command line.

        Specified by:
        values in interface OptionSpec<V>
        Parameters:
        detectedOptions - the detected options to search in
        Returns:
        the arguments associated with this option; an empty list if no such arguments are present, or if this option was not detected
        See Also:
        OptionSet.valuesOf(OptionSpec)
      • value

        public final V value​(OptionSet detectedOptions)
        Description copied from interface: OptionSpec
        Gives the argument associated with the given option in the given set of detected options.

        Specifying a default argument value for this option will cause this method to return that default value even if this option was not detected on the command line, or if this option can take an optional argument but did not have one on the command line.

        Specified by:
        value in interface OptionSpec<V>
        Parameters:
        detectedOptions - the detected options to search in
        Returns:
        the argument of the this option; null if no argument is present, or that option was not detected
        See Also:
        OptionSet.valueOf(OptionSpec)
      • isForHelp

        public final boolean isForHelp()
        Description copied from interface: OptionSpec
        Tells whether this option is designated as a "help" option. The presence of a "help" option on a command line means that missing "required" options will not cause parsing to fail.
        Specified by:
        isForHelp in interface OptionSpec<V>
        Returns:
        whether this option is designated as a "help" option
      • representsNonOptions

        public boolean representsNonOptions()
        Description copied from interface: OptionDescriptor
        Tells whether this object represents the non-option arguments of a command line.
        Specified by:
        representsNonOptions in interface OptionDescriptor
        Returns:
        true if this represents non-option arguments
      • convert

        protected abstract V convert​(String argument)
      • argumentTypeIndicatorFrom

        protected String argumentTypeIndicatorFrom​(ValueConverter<V> converter)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object