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 with CommandFactory.getCommandDefinition(String...)
  • Constructor Details

    • CommandDefinition

      protected CommandDefinition(String[] name)
  • Method Details

    • getName

      public String[] getName()
      The fully qualified name of this command.
    • compareTo

      public int compareTo(CommandDefinition o)
      Specified by:
      compareTo in interface Comparable<CommandDefinition>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • 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.