public class CommandArgumentDefinition<DataType> extends Object implements Comparable<CommandArgumentDefinition<?>>
CommandStep
.
Includes metadata about the argument such as a description, if it is required, a default value, etc.
Because this definition is tied to a specific step, multiple steps in a pipeline can define arguments of the same name.
for constructing new instances.
Modifier and Type | Class and Description |
---|---|
static class |
CommandArgumentDefinition.Building<DataType>
A new
CommandArgumentDefinition under construction from CommandBuilder |
Modifier | Constructor and Description |
---|---|
protected |
CommandArgumentDefinition(String name,
Class<DataType> type) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(CommandArgumentDefinition<?> o) |
boolean |
equals(Object o) |
SortedSet<String> |
getAliases()
Aliases for the argument.
|
Class<DataType> |
getDataType()
The datatype this argument will return.
|
DataType |
getDefaultValue()
The default value to use for this argument
|
String |
getDefaultValueDescription()
A description of the default value.
|
String |
getDescription()
The description of the argument.
|
boolean |
getHidden()
Hidden arguments are ones that can be called via integrations, but should not be normally shown in help to users.
|
String |
getName()
The name of the argument.
|
CommandArgumentDefinition<?> |
getSupersededBy() |
ConfigurationValueConverter<DataType> |
getValueConverter()
Function for converting values set in underlying
ConfigurationValueProvider s into the
type needed for this command. |
ConfigurationValueObfuscator<DataType> |
getValueObfuscator()
Used when sending the value to user output to protect secure values.
|
int |
hashCode() |
boolean |
isRequired()
Whether this argument is required.
|
void |
setSupersededBy(CommandArgumentDefinition<?> supersededBy) |
String |
toString() |
void |
validate(CommandScope commandScope)
Validates that the value stored in the given
CommandScope is valid. |
public String getName()
public SortedSet<String> getAliases()
public String getDescription()
public boolean isRequired()
validate(CommandScope)
will ensure required values are set.public CommandArgumentDefinition<?> getSupersededBy()
public void setSupersededBy(CommandArgumentDefinition<?> supersededBy)
public boolean getHidden()
public DataType getDefaultValue()
public String getDefaultValueDescription()
String.valueOf(Object)
of getDefaultValue()
but
can be explicitly with CommandArgumentDefinition.Building.defaultValue(Object, String)
.public ConfigurationValueConverter<DataType> getValueConverter()
ConfigurationValueProvider
s into the
type needed for this command.public ConfigurationValueObfuscator<DataType> getValueObfuscator()
public void validate(CommandScope commandScope) throws CommandValidationException
CommandScope
is valid.CommandValidationException
- if the stored value is not valid.public int compareTo(CommandArgumentDefinition<?> o)
compareTo
in interface Comparable<CommandArgumentDefinition<?>>
Copyright © 2023 Liquibase.org. All rights reserved.