Class CliCommand<GlobalFlagsT extends CliFlags,​CommandFlagsT extends CliFlags>

  • All Implemented Interfaces:
    Command<GlobalFlagsT>
    Direct Known Subclasses:
    BKCommand, CliCommandGroup

    public class CliCommand<GlobalFlagsT extends CliFlags,​CommandFlagsT extends CliFlags>
    extends java.lang.Object
    implements Command<GlobalFlagsT>
    A command that runs a CLI spec. it is typically used for nested sub commands.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Boolean apply​(GlobalFlagsT globalFlags, java.lang.String[] args)
      Process the command.
      java.lang.String category()
      Return category of this command belongs to.
      java.lang.String description()
      Return description name.
      java.lang.String getUsage()  
      java.lang.String name()
      Return command name.
      java.lang.String path()
      Return command path in a cli path.
      void setParent​(java.lang.String parent)  
      void usage()
      Print the help information.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.bookkeeper.tools.framework.Command

        hidden
    • Method Detail

      • setParent

        public void setParent​(java.lang.String parent)
      • category

        public java.lang.String category()
        Description copied from interface: Command
        Return category of this command belongs to.
        Specified by:
        category in interface Command<GlobalFlagsT extends CliFlags>
        Returns:
        category name
      • name

        public java.lang.String name()
        Description copied from interface: Command
        Return command name.
        Specified by:
        name in interface Command<GlobalFlagsT extends CliFlags>
        Returns:
        command name.
      • path

        public java.lang.String path()
        Description copied from interface: Command
        Return command path in a cli path.

        This is used for printing usage information.

        Specified by:
        path in interface Command<GlobalFlagsT extends CliFlags>
        Returns:
        command path
      • description

        public java.lang.String description()
        Description copied from interface: Command
        Return description name.
        Specified by:
        description in interface Command<GlobalFlagsT extends CliFlags>
        Returns:
        description name.
      • apply

        public java.lang.Boolean apply​(GlobalFlagsT globalFlags,
                                       java.lang.String[] args)
        Description copied from interface: Command
        Process the command.
        Specified by:
        apply in interface Command<GlobalFlagsT extends CliFlags>
        args - command args
        Returns:
        true if successfully apply the args, otherwise false
      • getUsage

        public java.lang.String getUsage()