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 specific
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.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA newCommandArgumentDefinitionunder construction fromCommandBuilder -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCommandArgumentDefinition(String name, Class<DataType> type) -
Method Summary
Modifier and TypeMethodDescriptionintbooleanAliases for the argument.The datatype this argument will return.The default value to use for this argumentA description of the default value.The description of the argument.booleanHidden arguments are ones that can be called via integrations, but should not be normally shown in help to users.getName()The name of the argument.Function for converting values set in underlyingConfigurationValueProviders into the type needed for this command.Used when sending the value to user output to protect secure values.inthashCode()booleanWhether this argument is required.voidsetSupersededBy(CommandArgumentDefinition<?> supersededBy) toString()voidvalidate(CommandScope commandScope) Validates that the value stored in the givenCommandScopeis valid.
-
Constructor Details
-
CommandArgumentDefinition
-
-
Method Details
-
getName
The name of the argument. Must be camelCase alphanumeric. -
getAliases
Aliases for the argument. Must be camelCase alphanumeric. -
getDescription
The description of the argument. Used in generated help documentation. -
getDataType
The datatype this argument will return. -
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
-
setSupersededBy
-
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
The default value to use for this argument -
getDefaultValueDescription
A description of the default value. Defaults toString.valueOf(Object)ofgetDefaultValue()but can be explicitly withCommandArgumentDefinition.Building.defaultValue(Object, String). -
getValueConverter
Function for converting values set in underlyingConfigurationValueProviders into the type needed for this command. -
getValueObfuscator
Used when sending the value to user output to protect secure values. -
validate
Validates that the value stored in the givenCommandScopeis valid.- Throws:
CommandValidationException- if the stored value is not valid.
-
compareTo
- Specified by:
compareToin interfaceComparable<DataType>
-
equals
-
hashCode
public int hashCode() -
toString
-