public abstract class OptionType extends Object
| Modifier and Type | Method and Description |
|---|---|
static OptionType |
flag(Character flag)
Get the non-value boolean flag type of parameter.
|
abstract Character |
getFlag()
Get the flag associated with this parameter.
|
abstract boolean |
isOptional()
Get whether this parameter is optional.
|
abstract boolean |
isValueFlag()
Return whether the flag is a value flag.
|
static OptionType |
optionalPositional()
Get the optional positional type of parameter.
|
static OptionType |
positional()
Get the required positional type of parameter.
|
abstract CommandArgs |
transform(CommandArgs arguments)
Create a new list of command arguments for the given arguments that
is appropriate for this type of parameter.
|
static OptionType |
valueFlag(Character flag)
Get the value flag type of parameter.
|
@Nullable public abstract Character getFlag()
isValueFlag()public abstract boolean isValueFlag()
getFlag()public abstract boolean isOptional()
public abstract CommandArgs transform(CommandArgs arguments)
For example, if the type of parameter is a value flag, then the returned arguments object will only have the value flag's value as the argument.
arguments - The list of argumentspublic static OptionType positional()
public static OptionType optionalPositional()
public static OptionType flag(Character flag)
public static OptionType valueFlag(Character flag)
Copyright © 2015. All Rights Reserved.