T
- the generic typeorg.refcodes.mixin.AliasAccessor
, ArgsAccessor
, org.refcodes.mixin.Clonable
, Cloneable
, Comparable<Operand<?>>
, org.refcodes.mixin.DescriptionAccessor
, org.refcodes.component.Resetable
, Syntaxable
, SyntaxUsage
, org.refcodes.mixin.TypeAccessor<T>
, org.refcodes.mixin.ValueAccessor<T>
Option<T>
AbstractOperand
, AbstractOption
, ArrayOperand
, ArrayOption
, CharOption
, DebugFlag
, DoubleOption
, EnumOption
, FileOption
, Flag
, FloatOption
, ForceFlag
, HelpFlag
, IntOption
, LongOption
, Operation
, QuietFlag
, StringOperand
, StringOption
, SysInfoFlag
, VerboseFlag
public interface Operand<T> extends org.refcodes.mixin.ValueAccessor<T>, org.refcodes.mixin.DescriptionAccessor, org.refcodes.mixin.TypeAccessor<T>, Syntaxable, ArgsAccessor, Comparable<Operand<?>>, org.refcodes.mixin.AliasAccessor, Cloneable, org.refcodes.mixin.Clonable
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[], 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.AliasAccessor.AliasBuilder<B extends org.refcodes.mixin.AliasAccessor.AliasBuilder<B>>, org.refcodes.mixin.AliasAccessor.AliasMutator, org.refcodes.mixin.AliasAccessor.AliasProperty
ArgsAccessor.ArgsMutator, ArgsAccessor.ArgsProperty
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.TypeBuilder<T extends Object,B extends org.refcodes.mixin.TypeAccessor.TypeBuilder<T,B>>, org.refcodes.mixin.TypeAccessor.TypeMutator<T extends Object>, org.refcodes.mixin.TypeAccessor.TypeProperty<T extends Object>
org.refcodes.mixin.ValueAccessor.ValueBuilder<V extends Object,B extends org.refcodes.mixin.ValueAccessor.ValueBuilder<V,B>>, org.refcodes.mixin.ValueAccessor.ValueMutator<V extends Object>, org.refcodes.mixin.ValueAccessor.ValueProperty<V extends Object>
Modifier and Type | Method | Description |
---|---|---|
default <V> V |
get(String aAlias) |
Searches for a value being set for the given for given alias in the
syntax tree parsing the command line arguments; if a node in the syntax
tree has a value for the given alias, then this value is returned.
|
String |
getAlias() |
|
String[] |
getArgs() |
Retrieves the command line arguments from the args property.
|
T |
getValue() |
|
default boolean |
hasValue() |
When being parsed via the
Syntaxable.parseArgs(String[], String[]) method,
use this method to determine whether the getValue() method
contains parsed value. |
compareTo
parseArgs, parseArgs, toState, toSyntax, toSyntax
toUsage, toUsage, toUsage
default boolean hasValue()
Syntaxable.parseArgs(String[], String[])
method,
use this method to determine whether the getValue()
method
contains parsed value.Syntaxable.parseArgs(String[], String[])
method.String[] getArgs()
getArgs
in interface ArgsAccessor
String getAlias()
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, String, String)
and
the command line arguments detail description when creating a command
line tool's help output. Attention: The alias can also be used as a key
when putting an Operand
's key/value-pair into a dictionary such
as is done by the RuntimeProperties
type provided by the
refcodes-properties-ext-runime
artifact!getAlias
in interface org.refcodes.mixin.AliasAccessor
default <V> V get(String aAlias)
get
in interface Syntaxable
V
- The type of the value being expected.aAlias
- The alias for which to seek for a value being set.Copyright © 2021. All rights reserved.