Class CommandRegistration.DefaultOptionSpec
java.lang.Object
org.springframework.shell.command.CommandRegistration.DefaultOptionSpec
- All Implemented Interfaces:
CommandRegistration.OptionSpec
- Enclosing interface:
- CommandRegistration
public static class CommandRegistration.DefaultOptionSpec
extends Object
implements CommandRegistration.OptionSpec
-
Method Summary
Modifier and TypeMethodDescriptionand()
Return a builder for chaining.arity
(int min, int max) Define anarity
for an option.Define anarity
for an option.completion
(CompletionResolver completion) Define acompletion function
for an option.defaultValue
(String defaultValue) Define adefaultValue
for an option.description
(String description) Define adescription
for an option.getLabel()
String[]
org.springframework.core.ResolvableType
getType()
boolean
Define alabel
for an option.Define long option names.Define an optional hint for possible positional mapping.required()
Define option to be required.required
(boolean required) Define if option is required.shortNames
(Character... names) Define short option names.Define a type for an option.
-
Method Details
-
longNames
Description copied from interface:CommandRegistration.OptionSpec
Define long option names.- Specified by:
longNames
in interfaceCommandRegistration.OptionSpec
- Parameters:
names
- the long option names- Returns:
- option spec for chaining
-
shortNames
Description copied from interface:CommandRegistration.OptionSpec
Define short option names.- Specified by:
shortNames
in interfaceCommandRegistration.OptionSpec
- Parameters:
names
- the long option names- Returns:
- option spec for chaining
-
type
Description copied from interface:CommandRegistration.OptionSpec
Define a type for an option.- Specified by:
type
in interfaceCommandRegistration.OptionSpec
- Parameters:
type
- the type- Returns:
- option spec for chaining
-
description
Description copied from interface:CommandRegistration.OptionSpec
Define adescription
for an option.- Specified by:
description
in interfaceCommandRegistration.OptionSpec
- Parameters:
description
- the option description- Returns:
- option spec for chaining
-
required
Description copied from interface:CommandRegistration.OptionSpec
Define if option is required.- Specified by:
required
in interfaceCommandRegistration.OptionSpec
- Parameters:
required
- the required flag- Returns:
- option spec for chaining
-
required
Description copied from interface:CommandRegistration.OptionSpec
Define option to be required. Syntatic sugar callingCommandRegistration.OptionSpec.required(boolean)
withtrue
.- Specified by:
required
in interfaceCommandRegistration.OptionSpec
- Returns:
- option spec for chaining
-
defaultValue
Description copied from interface:CommandRegistration.OptionSpec
Define adefaultValue
for an option.- Specified by:
defaultValue
in interfaceCommandRegistration.OptionSpec
- Parameters:
defaultValue
- the option default value- Returns:
- option spec for chaining
-
position
Description copied from interface:CommandRegistration.OptionSpec
Define an optional hint for possible positional mapping.- Specified by:
position
in interfaceCommandRegistration.OptionSpec
- Parameters:
position
- the position- Returns:
- option spec for chaining
-
arity
Description copied from interface:CommandRegistration.OptionSpec
Define anarity
for an option.- Specified by:
arity
in interfaceCommandRegistration.OptionSpec
- Parameters:
min
- the min aritymax
- the max arity- Returns:
- option spec for chaining
-
arity
Description copied from interface:CommandRegistration.OptionSpec
Define anarity
for an option.- Specified by:
arity
in interfaceCommandRegistration.OptionSpec
- Parameters:
arity
- the arity- Returns:
- option spec for chaining
-
label
Description copied from interface:CommandRegistration.OptionSpec
Define alabel
for an option.- Specified by:
label
in interfaceCommandRegistration.OptionSpec
- Parameters:
label
- the label- Returns:
- option spec for chaining
-
completion
Description copied from interface:CommandRegistration.OptionSpec
Define acompletion function
for an option.- Specified by:
completion
in interfaceCommandRegistration.OptionSpec
- Parameters:
completion
- the completion function- Returns:
- option spec for chaining
-
and
Description copied from interface:CommandRegistration.OptionSpec
Return a builder for chaining.- Specified by:
and
in interfaceCommandRegistration.OptionSpec
- Returns:
- a builder for chaining
-
getLongNames
-
getShortNames
-
getType
public org.springframework.core.ResolvableType getType() -
getDescription
-
isRequired
public boolean isRequired() -
getDefaultValue
-
getPosition
-
getArityMin
-
getArityMax
-
getLabel
-
getCompletion
-