Package liquibase.command
Class CommandArgumentDefinition<DataType>
- java.lang.Object
-
- liquibase.command.CommandArgumentDefinition<DataType>
-
- All Implemented Interfaces:
Comparable<CommandArgumentDefinition<?>>
public class CommandArgumentDefinition<DataType> extends Object implements Comparable<CommandArgumentDefinition<?>>
Defines a known, type-safe argument for a specificCommandStep. 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.
- See Also:
for constructing new instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCommandArgumentDefinition.Building<DataType>A newCommandArgumentDefinitionunder construction fromCommandBuilder
-
Constructor Summary
Constructors Modifier Constructor Description protectedCommandArgumentDefinition(String name, Class<DataType> type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(CommandArgumentDefinition<?> o)booleanequals(Object o)SortedSet<String>getAliases()Aliases for the argument.Class<DataType>getDataType()The datatype this argument will return.DataTypegetDefaultValue()The default value to use for this argumentStringgetDefaultValueDescription()A description of the default value.StringgetDescription()The description of the argument.booleangetHidden()Hidden arguments are ones that can be called via integrations, but should not be normally shown in help to users.StringgetName()The name of the argument.CommandArgumentDefinition<?>getSupersededBy()ConfigurationValueConverter<DataType>getValueConverter()Function for converting values set in underlyingConfigurationValueProviders into the type needed for this command.ConfigurationValueObfuscator<DataType>getValueObfuscator()Used when sending the value to user output to protect secure values.inthashCode()booleanisRequired()Whether this argument is required.voidsetSupersededBy(CommandArgumentDefinition<?> supersededBy)StringtoString()voidvalidate(CommandScope commandScope)Validates that the value stored in the givenCommandScopeis valid.
-
-
-
Method Detail
-
getName
public String getName()
The name of the argument. Must be camelCase alphanumeric.
-
getAliases
public SortedSet<String> getAliases()
Aliases for the argument. Must be camelCase alphanumeric.
-
getDescription
public String getDescription()
The description of the argument. Used in generated help documentation.
-
isRequired
public boolean isRequired()
Whether this argument is required. Exposed as a separate setting for help doc purposes.validate(CommandScope)will ensure required values are set.
-
getSupersededBy
public CommandArgumentDefinition<?> getSupersededBy()
-
setSupersededBy
public void setSupersededBy(CommandArgumentDefinition<?> supersededBy)
-
getHidden
public boolean getHidden()
Hidden arguments are ones that can be called via integrations, but should not be normally shown in help to users.
-
getDefaultValue
public DataType getDefaultValue()
The default value to use for this argument
-
getDefaultValueDescription
public String getDefaultValueDescription()
A description of the default value. Defaults toString.valueOf(Object)ofgetDefaultValue()but can be explicitly withCommandArgumentDefinition.Building.defaultValue(Object, String).
-
getValueConverter
public ConfigurationValueConverter<DataType> getValueConverter()
Function for converting values set in underlyingConfigurationValueProviders into the type needed for this command.
-
getValueObfuscator
public ConfigurationValueObfuscator<DataType> getValueObfuscator()
Used when sending the value to user output to protect secure values.
-
validate
public void validate(CommandScope commandScope) throws CommandValidationException
Validates that the value stored in the givenCommandScopeis valid.- Throws:
CommandValidationException- if the stored value is not valid.
-
compareTo
public int compareTo(CommandArgumentDefinition<?> o)
- Specified by:
compareToin interfaceComparable<DataType>
-
-