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 protectedCommandDefinition(String[] name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(CommandArgumentDefinition commandArg)voidaddAlias(String[] alias)Add an alias to the command.intcompareTo(CommandDefinition o)booleanequals(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.StringgetGroupHelpFooter()StringgetGroupLongDescription(String[] group)The long description of the given command group.StringgetGroupShortDescription(String[] group)The short description of the given command group.StringgetHelpFooter()booleangetHidden()Hidden commands are ones that can be called via integrations, but should not be normally shown in help to users.booleangetInternal()Internal commands are ones that can be called programmatically, but should not be exposed directly and automatically through integrations.StringgetLongDescription()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 pipelineStringgetShortDescription()The short description of the command.inthashCode()booleanis(String... commandName)Return true if this command represents the given commandvoidsetGroupHelpFooter(String groupFooter)voidsetGroupLongDescription(String[] group, String longDescription)voidsetGroupShortDescription(String[] group, String shortDescription)Sets the short description of the given command group for help docs.voidsetHelpFooter(String footer)voidsetHidden(boolean hidden)voidsetInternal(boolean internal)voidsetLongDescription(String longDescription)voidsetShortDescription(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:
compareToin 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.
-
-