Package org.refcodes.console
Interface Option<T>
-
- Type Parameters:
T
- the generic type
- All Superinterfaces:
org.refcodes.mixin.AliasAccessor
,ArgsAccessor
,Comparable<T>
,org.refcodes.mixin.DescriptionAccessor
,Operand<T>
,org.refcodes.component.Resetable
,Syntaxable
,SyntaxUsage
,org.refcodes.mixin.TypeAccessor<T>
,org.refcodes.mixin.ValueAccessor<T>
- All Known Implementing Classes:
AbstractOption
,DebugFlag
,DoubleOption
,EnumOption
,FileOption
,Flag
,FloatOption
,ForceFlag
,HelpFlag
,IntegerOption
,LongOption
,QuietFlag
,StringOption
,SysInfoFlag
,VerboseFlag
public interface Option<T> extends Operand<T>
AnOption
represents a command line option with the according option's value. AnOption
can be seen as a key/value(s) pair defined in the command line arguments parsed via theSyntaxable.parseArgs(String[], String[])
method.An
Option
has a state which changes with each invocation of theSyntaxable.parseArgs(String[], String[])
method.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.AliasAccessor
org.refcodes.mixin.AliasAccessor.AliasBuilder<B extends org.refcodes.mixin.AliasAccessor.AliasBuilder<B>>, org.refcodes.mixin.AliasAccessor.AliasMutator, org.refcodes.mixin.AliasAccessor.AliasProperty
-
Nested classes/interfaces inherited from interface org.refcodes.console.ArgsAccessor
ArgsAccessor.ArgsMutator, ArgsAccessor.ArgsProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.DescriptionAccessor
org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<B extends org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<B>>, org.refcodes.mixin.DescriptionAccessor.DescriptionMutator, org.refcodes.mixin.DescriptionAccessor.DescriptionProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.TypeAccessor
org.refcodes.mixin.TypeAccessor.TypeMutator<T extends Object>, org.refcodes.mixin.TypeAccessor.TypeProperty<T extends Object>
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.ValueAccessor
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>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
getLongOption()
TODO: Make the option to be required without the hyphen-minuses "--" Returns the long-option representing anOption
instance.default String[]
getOptions()
Retrieves an array of the options being configured for the implementing instance, being the long option (when set) and the short option (when set).String
getShortOption()
Returns the short-option representing anOption
instance.-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.refcodes.console.Operand
get, getAlias, getArgs, getValue, hasValue
-
Methods inherited from interface org.refcodes.console.Syntaxable
parseArgs, parseArgs, toState, toSyntax, toSyntax
-
Methods inherited from interface org.refcodes.console.SyntaxUsage
toUsage, toUsage, toUsage
-
-
-
-
Method Detail
-
getShortOption
String getShortOption()
Returns the short-option representing anOption
instance. A short option usually is being prefixed with a single hyphen-minus "-" as defined inCommandArgPrefix.POSIX_SHORT_OPTION
.- Returns:
- The short-option
String
.
-
getLongOption
String getLongOption()
TODO: Make the option to be required without the hyphen-minuses "--" Returns the long-option representing anOption
instance. A long option usually is being prefixed with a double hyphen-minus "--" as defined inCommandArgPrefix.POSIX_LONG_OPTION
.- Returns:
- The long-option
String
.
-
getOptions
default String[] getOptions()
Retrieves an array of the options being configured for the implementing instance, being the long option (when set) and the short option (when set).- Returns:
- The array of options being the long option (if not null) and the short option (if not null).
-
-