- java.lang.Object
-
- com.github.rvesse.airline.model.CommandGroupMetadata
-
public class CommandGroupMetadata extends java.lang.Object
Represents meta-data about a command group
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<CommandMetadata>
commands
private CommandMetadata
defaultCommand
private java.lang.String
description
private boolean
hidden
private java.lang.String
name
private java.util.List<OptionMetadata>
options
private CommandGroupMetadata
parentGroup
private java.util.List<CommandGroupMetadata>
subGroups
-
Constructor Summary
Constructors Constructor Description CommandGroupMetadata(java.lang.String name, java.lang.String description, boolean hidden, java.lang.Iterable<OptionMetadata> options, java.lang.Iterable<CommandGroupMetadata> subGroups, CommandMetadata defaultCommand, java.lang.Iterable<CommandMetadata> commands)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCommand(CommandMetadata command)
Adds a command to the groupvoid
addSubGroup(CommandGroupMetadata subGroup)
Adds a sub-group to the groupjava.util.List<CommandMetadata>
getCommands()
Gets the commands for the groupCommandMetadata
getDefaultCommand()
Gets the default command for the groupjava.lang.String
getDescription()
Gets the description for the groupjava.lang.String
getName()
Gets the name of the groupjava.util.List<OptionMetadata>
getOptions()
Gets the group optionsCommandGroupMetadata
getParent()
Gets the parent group which may be nulljava.util.List<CommandGroupMetadata>
getSubGroups()
Gets the sub-groups of this groupboolean
isHidden()
Gets whether the group is hiddenvoid
setParent(CommandGroupMetadata parent)
Sets the parent for a groupjava.lang.String
toString()
-
-
-
Field Detail
-
name
private final java.lang.String name
-
description
private final java.lang.String description
-
hidden
private final boolean hidden
-
options
private final java.util.List<OptionMetadata> options
-
defaultCommand
private final CommandMetadata defaultCommand
-
commands
private final java.util.List<CommandMetadata> commands
-
subGroups
private final java.util.List<CommandGroupMetadata> subGroups
-
parentGroup
private CommandGroupMetadata parentGroup
-
-
Constructor Detail
-
CommandGroupMetadata
public CommandGroupMetadata(java.lang.String name, java.lang.String description, boolean hidden, java.lang.Iterable<OptionMetadata> options, java.lang.Iterable<CommandGroupMetadata> subGroups, CommandMetadata defaultCommand, java.lang.Iterable<CommandMetadata> commands)
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the name of the group- Returns:
- Name
-
getDescription
public java.lang.String getDescription()
Gets the description for the group- Returns:
- Description
-
isHidden
public boolean isHidden()
Gets whether the group is hidden- Returns:
- True if hidden, false otherwise
-
getOptions
public java.util.List<OptionMetadata> getOptions()
Gets the group options- Returns:
- Group options
-
getDefaultCommand
public CommandMetadata getDefaultCommand()
Gets the default command for the group- Returns:
- Default command
-
getCommands
public java.util.List<CommandMetadata> getCommands()
Gets the commands for the group- Returns:
- Commands
-
addCommand
public void addCommand(CommandMetadata command)
Adds a command to the group- Parameters:
command
- Command
-
getSubGroups
public java.util.List<CommandGroupMetadata> getSubGroups()
Gets the sub-groups of this group- Returns:
- Sub-groups
-
addSubGroup
public void addSubGroup(CommandGroupMetadata subGroup)
Adds a sub-group to the group- Parameters:
subGroup
- Sub-group
-
setParent
public void setParent(CommandGroupMetadata parent)
Sets the parent for a group- Parameters:
parent
- Parent group
-
getParent
public CommandGroupMetadata getParent()
Gets the parent group which may be null- Returns:
- Parent group, null if a top level group
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-