V
- represents the type of the arguments this option acceptspublic abstract class AbstractOptionSpec<V> extends Object implements OptionSpec<V>, OptionDescriptor
Modifier and Type | Method and Description |
---|---|
String |
description()
Description of this option's purpose.
|
boolean |
equals(Object that) |
AbstractOptionSpec<V> |
forHelp() |
int |
hashCode() |
boolean |
isForHelp()
Tells whether this option is designated as a "help" option.
|
List<String> |
options()
A set of options that are mutually synonymous.
|
boolean |
representsNonOptions()
Tells whether this object represents the non-option arguments of a command line.
|
String |
toString() |
V |
value(OptionSet detectedOptions)
Gives the argument associated with the given option in the given set of detected options.
|
Optional<V> |
valueOptional(OptionSet detectedOptions)
Gives the argument associated with the given option in the given set of detected options
as an
Optional . |
List<V> |
values(OptionSet detectedOptions)
Gives any arguments associated with the given option in the given set of detected options.
|
acceptsArguments, argumentConverter, argumentDescription, argumentTypeIndicator, defaultValues, isRequired, requiresArgument
public final List<String> options()
OptionDescriptor
options
in interface OptionDescriptor
options
in interface OptionSpec<V>
public final List<V> values(OptionSet detectedOptions)
OptionSpec
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.
values
in interface OptionSpec<V>
detectedOptions
- the detected options to search inOptionSet.valuesOf(OptionSpec)
public final V value(OptionSet detectedOptions)
OptionSpec
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.
value
in interface OptionSpec<V>
detectedOptions
- the detected options to search innull
if no argument is present, or that option was not detectedOptionSet.valueOf(OptionSpec)
public final Optional<V> valueOptional(OptionSet detectedOptions)
OptionSpec
Optional
.
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.
valueOptional
in interface OptionSpec<V>
detectedOptions
- the detected options to search inOptional
OptionSet.valueOf(OptionSpec)
public String description()
OptionDescriptor
description
in interface OptionDescriptor
public final AbstractOptionSpec<V> forHelp()
public final boolean isForHelp()
OptionSpec
isForHelp
in interface OptionSpec<V>
public boolean representsNonOptions()
OptionDescriptor
representsNonOptions
in interface OptionDescriptor
true
if this represents non-option arguments© Copyright 2004-2016 Paul R. Holser, Jr. All rights reserved. Licensed under The MIT License.