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 abstract static class CommandRegistration.BaseBuilder
extends Object
implements CommandRegistration.Builder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionavailability
(Supplier<Availability> availability) Define anAvailability
suppliear for a command.build()
Builds aCommandRegistration
.Define commands this registration uses.defaultOptionNameModifier
(Function<String, String> modifier) Provides a global option name modifier.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.DefineInteractionMode
for 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 help options what this command should use.Define 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.Builder
Define 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:
command
in interfaceCommandRegistration.Builder
- Parameters:
commands
- the commands- Returns:
- builder for chaining
-
interactionMode
Description copied from interface:CommandRegistration.Builder
DefineInteractionMode
for a command.- Specified by:
interactionMode
in interfaceCommandRegistration.Builder
- Parameters:
mode
- the interaction mode- Returns:
- builder for chaining
-
description
Description copied from interface:CommandRegistration.Builder
Define a description text for a command.- Specified by:
description
in interfaceCommandRegistration.Builder
- Parameters:
description
- the description text- Returns:
- builder for chaining
-
group
Description copied from interface:CommandRegistration.Builder
Define a group for a command.- Specified by:
group
in interfaceCommandRegistration.Builder
- Parameters:
group
- the group- Returns:
- builder for chaining
-
availability
Description copied from interface:CommandRegistration.Builder
Define anAvailability
suppliear for a command.- Specified by:
availability
in interfaceCommandRegistration.Builder
- Parameters:
availability
- the availability- Returns:
- builder for chaining
-
defaultOptionNameModifier
Description copied from interface:CommandRegistration.Builder
Provides a global option name modifier. Will be used with all options to modify long names. Usual use case is to enforce naming convention i.e. to havesnake-case
for all names.- Specified by:
defaultOptionNameModifier
in interfaceCommandRegistration.Builder
- Parameters:
modifier
- to modifier to change option name- Returns:
- builder for chaining
-
withOption
Description copied from interface:CommandRegistration.Builder
Define an option what this command should user for. Can be used multiple times.- Specified by:
withOption
in interfaceCommandRegistration.Builder
- Returns:
- option spec for chaining
-
withTarget
Description copied from interface:CommandRegistration.Builder
Define a target what this command should execute- Specified by:
withTarget
in interfaceCommandRegistration.Builder
- Returns:
- target spec for chaining
-
withAlias
Description copied from interface:CommandRegistration.Builder
Define an alias what this command should execute- Specified by:
withAlias
in interfaceCommandRegistration.Builder
- Returns:
- alias spec for chaining
-
withExitCode
Description copied from interface:CommandRegistration.Builder
Define an exit code what this command should execute- Specified by:
withExitCode
in interfaceCommandRegistration.Builder
- Returns:
- exit code spec for chaining
-
withErrorHandling
Description copied from interface:CommandRegistration.Builder
Define an error handling what this command should use- Specified by:
withErrorHandling
in interfaceCommandRegistration.Builder
- Returns:
- error handling spec for chaining
-
withHelpOptions
Description copied from interface:CommandRegistration.Builder
Define help options what this command should use.- Specified by:
withHelpOptions
in interfaceCommandRegistration.Builder
- Returns:
- help options spec for chaining
-
build
Description copied from interface:CommandRegistration.Builder
Builds aCommandRegistration
.- Specified by:
build
in interfaceCommandRegistration.Builder
- Returns:
- a command registration
-