T
- the generic typepublic interface Operand<T> extends org.refcodes.mixin.ValueAccessor<T>, org.refcodes.mixin.DescriptionAccessor, org.refcodes.mixin.TypeAccessor<T>, Syntaxable, ArgsAccessor, Comparable<Operand<?>>
Operand
represents a value parsed from command line arguments. In
comparison to an Option
an Operand
just represents a plain
value without an identifier in front of it. An Operand
has a state
which changes with each invocation of the Syntaxable.parseArgs(String[])
method.
It is recommended to put your Operand
instance(s) at the end of your
top Condition
to enforce it to be the last Syntaxable
(s) when
parsing the command line arguments - this makes sure that any Option
s
pick their option arguments so that the Operand
(s) will correctly be
left over for parsing command line argument(s); the Operand
will not
pick by mistake an option argument.
org.refcodes.mixin.ValueAccessor.ValueBuilder<V,B extends org.refcodes.mixin.ValueAccessor.ValueBuilder<V,B>>, org.refcodes.mixin.ValueAccessor.ValueMutator<V>, org.refcodes.mixin.ValueAccessor.ValueProperty<V>
org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<B extends org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<B>>, org.refcodes.mixin.DescriptionAccessor.DescriptionMutator, org.refcodes.mixin.DescriptionAccessor.DescriptionProperty
org.refcodes.mixin.TypeAccessor.TypeMutator<T>, org.refcodes.mixin.TypeAccessor.TypeProperty<T>
ArgsAccessor.ArgsMutator, ArgsAccessor.ArgsProperty
Modifier and Type | Method and Description |
---|---|
String[] |
getArgs()
Retrieves the command line arguments from the args property.
|
String |
getParameterName()
|
T |
getValue() |
default boolean |
hasValue()
When being parsed via the
Syntaxable.parseArgs(String[]) method, use this
method to determine whether the getValue() method contains
parsed value. |
parseArgs, parseSyntax, toState, toSyntax
compareTo
default boolean hasValue()
Syntaxable.parseArgs(String[])
method, use this
method to determine whether the getValue()
method contains
parsed value.Syntaxable.parseArgs(String[])
method.String[] getArgs()
getArgs
in interface ArgsAccessor
String getParameterName()
Operand
) or the option argument (Option
),
depending on the sub-type inheriting from this interface. The parameter
name is merely used for constructing the command line arguments syntax
String
via Syntaxable.toSyntax(SyntaxNotation)
and the command line
arguments detail description when creating a command line tool's help
output.Copyright © 2017. All rights reserved.