Package liquibase.command
Class CommandDefinition
- java.lang.Object
-
- liquibase.command.CommandDefinition
-
- All Implemented Interfaces:
Comparable<CommandDefinition>
public class CommandDefinition extends Object implements Comparable<CommandDefinition>
Metadata about a particular command. Look up instances withCommandFactory.getCommandDefinition(String...)
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CommandDefinition(String[] name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(CommandArgumentDefinition commandArg)
void
addAlias(String[] alias)
Add an alias to the command.int
compareTo(CommandDefinition o)
boolean
equals(Object o)
CommandArgumentDefinition<?>
getArgument(String argName)
Returns the given argument definition for this command.SortedMap<String,CommandArgumentDefinition<?>>
getArguments()
Returns the arguments for this command.<T> SortedSet<CommandArgumentDefinition<T>>
getArguments(Class<T> argumentType)
Convenience method to return the arguments for this command which are of a given type.String
getGroupHelpFooter()
String
getGroupLongDescription(String[] group)
The long description of the given command group.String
getGroupShortDescription(String[] group)
The short description of the given command group.String
getHelpFooter()
boolean
getHidden()
Hidden commands are ones that can be called via integrations, but should not be normally shown in help to users.boolean
getInternal()
Internal commands are ones that can be called programmatically, but should not be exposed directly and automatically through integrations.String
getLongDescription()
The long description of the command.String[]
getName()
The fully qualified name of this command.List<CommandStep>
getPipeline()
Returns the steps in the command's pipelineString
getShortDescription()
The short description of the command.int
hashCode()
boolean
is(String... commandName)
Return true if this command represents the given commandvoid
setGroupHelpFooter(String groupFooter)
void
setGroupLongDescription(String[] group, String longDescription)
void
setGroupShortDescription(String[] group, String shortDescription)
Sets the short description of the given command group for help docs.void
setHelpFooter(String footer)
void
setHidden(boolean hidden)
void
setInternal(boolean internal)
void
setLongDescription(String longDescription)
void
setShortDescription(String shortDescription)
-
-
-
Constructor Detail
-
CommandDefinition
protected CommandDefinition(String[] name)
-
-
Method Detail
-
getName
public String[] getName()
The fully qualified name of this command.
-
compareTo
public int compareTo(CommandDefinition o)
- Specified by:
compareTo
in interfaceComparable<CommandDefinition>
-
getPipeline
public List<CommandStep> getPipeline()
Returns the steps in the command's pipeline
-
getArgument
public CommandArgumentDefinition<?> getArgument(String argName)
Returns the given argument definition for this command. Handles argument name smoothing. Returns null if no argument matches.
-
getArguments
public SortedMap<String,CommandArgumentDefinition<?>> getArguments()
Returns the arguments for this command.
-
getArguments
public <T> SortedSet<CommandArgumentDefinition<T>> getArguments(Class<T> argumentType)
Convenience method to return the arguments for this command which are of a given type.
-
getShortDescription
public String getShortDescription()
The short description of the command. Used in help docs.
-
setShortDescription
public void setShortDescription(String shortDescription)
-
getGroupShortDescription
public String getGroupShortDescription(String[] group)
The short description of the given command group. Used in help docs.
-
setGroupShortDescription
public void setGroupShortDescription(String[] group, String shortDescription)
Sets the short description of the given command group for help docs. If multiple command commands set different descriptions for the group, which version will be shown in any rolled up help is undefined.
-
getGroupLongDescription
public String getGroupLongDescription(String[] group)
The long description of the given command group. Used in help docs. If multiple command commands set different descriptions for the group, which version will be shown in any rolled up help is undefined.
-
setGroupLongDescription
public void setGroupLongDescription(String[] group, String longDescription)
-
getLongDescription
public String getLongDescription()
The long description of the command. Used in help docs.
-
setLongDescription
public void setLongDescription(String longDescription)
-
getHelpFooter
public String getHelpFooter()
-
setHelpFooter
public void setHelpFooter(String footer)
-
getGroupHelpFooter
public String getGroupHelpFooter()
-
setGroupHelpFooter
public void setGroupHelpFooter(String groupFooter)
-
add
public void add(CommandArgumentDefinition commandArg)
-
getInternal
public boolean getInternal()
Internal commands are ones that can be called programmatically, but should not be exposed directly and automatically through integrations.
-
setInternal
public void setInternal(boolean internal)
-
getHidden
public boolean getHidden()
Hidden commands are ones that can be called via integrations, but should not be normally shown in help to users. "Alias" or legacy commands are often marked as hidden commands.
-
setHidden
public void setHidden(boolean hidden)
-
is
public boolean is(String... commandName)
Return true if this command represents the given command
-
addAlias
public void addAlias(String[] alias)
Add an alias to the command.
-
-