- java.lang.Object
-
- com.github.rvesse.airline.model.CommandGroupMetadata
-
public class CommandGroupMetadata extends java.lang.ObjectRepresents meta-data about a command group
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<CommandMetadata>commandsprivate CommandMetadatadefaultCommandprivate java.lang.Stringdescriptionprivate booleanhiddenprivate java.lang.Stringnameprivate java.util.List<OptionMetadata>optionsprivate CommandGroupMetadataparentGroupprivate 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 voidaddCommand(CommandMetadata command)Adds a command to the groupvoidaddSubGroup(CommandGroupMetadata subGroup)Adds a sub-group to the groupjava.util.List<CommandMetadata>getCommands()Gets the commands for the groupCommandMetadatagetDefaultCommand()Gets the default command for the groupjava.lang.StringgetDescription()Gets the description for the groupjava.lang.StringgetName()Gets the name of the groupjava.util.List<OptionMetadata>getOptions()Gets the group optionsCommandGroupMetadatagetParent()Gets the parent group which may be nulljava.util.List<CommandGroupMetadata>getSubGroups()Gets the sub-groups of this groupbooleanisHidden()Gets whether the group is hiddenvoidsetParent(CommandGroupMetadata parent)Sets the parent for a groupjava.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
-