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 String
private boolean
private final String
private 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 benull
if 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 com.github.rvesse.airline.builder.AbstractChildBuilder
parent
Methods inherited from class com.github.rvesse.airline.builder.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 benull
if 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:AbstractBuilder
Builds the type- Specified by:
build
in classAbstractBuilder<CommandGroupMetadata>
- Returns:
- Type instance
-