Class CommandRegistration.BaseBuilder
java.lang.Object
org.springframework.shell.command.CommandRegistration.BaseBuilder
- All Implemented Interfaces:
CommandRegistration.Builder
- Direct Known Subclasses:
CommandRegistration.DefaultBuilder
- Enclosing interface:
- CommandRegistration
public static class CommandRegistration.BaseBuilder
extends Object
implements CommandRegistration.Builder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionavailability(Supplier<Availability> availability) Define anAvailabilitysuppliear for a command.build()Builds aCommandRegistration.Define commands this registration uses.description(String description) Define a description text for a command.Define a group for a command.hidden()Define a command to be hidden.hidden(boolean hidden) Define a command to be hidden by a given flag.DefineInteractionModefor a command.Define an alias what this command should executeDefine an error handling what this command should useDefine an exit code what this command should executeDefine an option what this command should user for.Define a target what this command should execute
-
Constructor Details
-
BaseBuilder
public BaseBuilder()
-
-
Method Details
-
command
Description copied from interface:CommandRegistration.BuilderDefine commands this registration uses. Essentially defines a full set of main and sub commands. It doesn't matter if full command is defined in one string or multiple strings as "words" are splitted and trimmed with whitespaces. You will get result ofcommand subcommand1 subcommand2, ....- Specified by:
commandin interfaceCommandRegistration.Builder- Parameters:
commands- the commands- Returns:
- builder for chaining
-
interactionMode
Description copied from interface:CommandRegistration.BuilderDefineInteractionModefor a command.- Specified by:
interactionModein interfaceCommandRegistration.Builder- Parameters:
mode- the interaction mode- Returns:
- builder for chaining
-
description
Description copied from interface:CommandRegistration.BuilderDefine a description text for a command.- Specified by:
descriptionin interfaceCommandRegistration.Builder- Parameters:
description- the description text- Returns:
- builder for chaining
-
group
Description copied from interface:CommandRegistration.BuilderDefine a group for a command.- Specified by:
groupin interfaceCommandRegistration.Builder- Parameters:
group- the group- Returns:
- builder for chaining
-
availability
Description copied from interface:CommandRegistration.BuilderDefine anAvailabilitysuppliear for a command.- Specified by:
availabilityin interfaceCommandRegistration.Builder- Parameters:
availability- the availability- Returns:
- builder for chaining
-
withOption
Description copied from interface:CommandRegistration.BuilderDefine an option what this command should user for. Can be used multiple times.- Specified by:
withOptionin interfaceCommandRegistration.Builder- Returns:
- option spec for chaining
-
withTarget
Description copied from interface:CommandRegistration.BuilderDefine a target what this command should execute- Specified by:
withTargetin interfaceCommandRegistration.Builder- Returns:
- target spec for chaining
-
withAlias
Description copied from interface:CommandRegistration.BuilderDefine an alias what this command should execute- Specified by:
withAliasin interfaceCommandRegistration.Builder- Returns:
- alias spec for chaining
-
withExitCode
Description copied from interface:CommandRegistration.BuilderDefine an exit code what this command should execute- Specified by:
withExitCodein interfaceCommandRegistration.Builder- Returns:
- exit code spec for chaining
-
withErrorHandling
Description copied from interface:CommandRegistration.BuilderDefine an error handling what this command should use- Specified by:
withErrorHandlingin interfaceCommandRegistration.Builder- Returns:
- error handling spec for chaining
-
build
Description copied from interface:CommandRegistration.BuilderBuilds aCommandRegistration.- Specified by:
buildin interfaceCommandRegistration.Builder- Returns:
- a command registration
-