Class GroupBuilder<C>
java.lang.Object
com.github.rvesse.airline.builder.AbstractBuilder<CommandGroupMetadata>
com.github.rvesse.airline.builder.AbstractChildBuilder<CommandGroupMetadata, Cli<C>, CliBuilder<C>>
com.github.rvesse.airline.builder.GroupBuilder<C>
public class GroupBuilder<C>
extends AbstractChildBuilder<CommandGroupMetadata, Cli<C>, CliBuilder<C>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate booleanprivate final Stringprivate final GroupBuilder<C> protected final Map<String, GroupBuilder<C>> -
Constructor Summary
ConstructorsConstructorDescriptionGroupBuilder(CliBuilder<C> cliBuilder, GroupBuilder<C> parentGroupBuilder, String name) GroupBuilder(CliBuilder<C> cliBuilder, String name) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the typegetSubGroup(String name) Gets the parent group builder which may benullif this is a top level group.withCommand(Class<? extends C> command) withCommands(Class<? extends C> command, Class<? extends C>... moreCommands) withCommands(Iterable<Class<? extends C>> commands) withDefaultCommand(Class<? extends C> defaultCommand) withDescription(String description) Sets the description for the groupwithHiddenState(boolean hidden) withSubGroup(String name) Methods inherited from class AbstractChildBuilder
parentMethods inherited from class AbstractBuilder
checkNotBlank, checkNotEmpty, checkNotNull
-
Field Details
-
name
-
description
-
defaultCommand
-
subGroups
-
parentGroupBuilder
-
commands
-
-
Constructor Details
-
GroupBuilder
GroupBuilder(CliBuilder<C> cliBuilder, String name) -
GroupBuilder
GroupBuilder(CliBuilder<C> cliBuilder, GroupBuilder<C> parentGroupBuilder, String name)
-
-
Method Details
-
withDescription
Sets the description for the group- Parameters:
description- Description- Returns:
- Group builder
-
makeHidden
-
makeVisible
-
withHiddenState
-
withSubGroup
-
getSubGroup
-
withDefaultCommand
-
withCommand
-
withCommands
-
withCommands
-
parentGroup
Gets the parent group builder which may benullif this is a top level group. You may alternatively want to callAbstractChildBuilder.parent()to get the actual CLI builder- Returns:
- Parent group builder (if any) or
null
-
build
Description copied from class:AbstractBuilderBuilds the type- Specified by:
buildin classAbstractBuilder<CommandGroupMetadata>- Returns:
- Type instance
-