public static class CommandProcessor.Option extends Object
Constructor and Description |
---|
Option(boolean requiresInput,
String... aliases)
Create a option with given aliases.
|
Option(String... aliases)
Create a command with given aliases.
|
Modifier and Type | Method and Description |
---|---|
String |
getDefaultValue()
Gets the default value of this option.
|
String |
getDescription() |
String |
getName()
Gets the first alias as the name.
|
static boolean |
isValidName(String s)
Affirms if the given string can be a valid option name.
|
boolean |
match(String name)
Affirms if the given name any of the aliases.
|
boolean |
requiresInput()
Affirms if this option requires a value.
|
CommandProcessor.Option |
setDefault(String v)
Sets the default value for this option.
|
CommandProcessor.Option |
setDescription(String desc) |
String |
toString() |
public Option(String... aliases)
aliases
- strings each must start with a dash (-
).public Option(boolean requiresInput, String... aliases)
requiresInput
- does it require a value?aliases
- strings each must start with a dash (-
).public static boolean isValidName(String s)
public String getName()
public CommandProcessor.Option setDefault(String v)
v
- a default value.IllegalStateException
- if this option does not require a value.public CommandProcessor.Option setDescription(String desc)
public String getDescription()
public boolean match(String name)
public boolean requiresInput()
public String getDefaultValue()
Copyright © 2006–2018 Apache Software Foundation. All rights reserved.