Class CommandOption.DefaultCommandOption
java.lang.Object
org.springframework.shell.command.CommandOption.DefaultCommandOption
- All Implemented Interfaces:
CommandOption
- Enclosing interface:
- CommandOption
Default implementation of
CommandOption
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.shell.command.CommandOption
CommandOption.DefaultCommandOption
-
Constructor Summary
ConstructorDescriptionDefaultCommandOption
(String[] longNames, String[] longNamesModified, Character[] shortNames, String description, org.springframework.core.ResolvableType type, boolean required, String defaultValue, Integer position, Integer arityMin, Integer arityMax, String label, CompletionResolver completion) -
Method Summary
Modifier and TypeMethodDescriptionint
Gets a maximum arity.int
Gets a minimum arity.Gets a completion function.Gets a default value of an option.Gets a description of an option.getLabel()
Gets a label.String[]
Gets a long names of an option.String[]
Gets a modified long names of an option.int
Gets a positional value.Gets a short names of an option.org.springframework.core.ResolvableType
getType()
Gets aResolvableType
of an option.boolean
Gets a flag if option is required.
-
Constructor Details
-
DefaultCommandOption
public DefaultCommandOption(String[] longNames, String[] longNamesModified, Character[] shortNames, String description, org.springframework.core.ResolvableType type, boolean required, String defaultValue, Integer position, Integer arityMin, Integer arityMax, String label, CompletionResolver completion)
-
-
Method Details
-
getLongNames
Description copied from interface:CommandOption
Gets a long names of an option.- Specified by:
getLongNames
in interfaceCommandOption
- Returns:
- long names of an option
-
getLongNamesModified
Description copied from interface:CommandOption
Gets a modified long names of an option. Set within a command registration if option name modifier were used to have an info about original names.- Specified by:
getLongNamesModified
in interfaceCommandOption
- Returns:
- modified long names of an option
-
getShortNames
Description copied from interface:CommandOption
Gets a short names of an option.- Specified by:
getShortNames
in interfaceCommandOption
- Returns:
- short names of an option
-
getDescription
Description copied from interface:CommandOption
Gets a description of an option.- Specified by:
getDescription
in interfaceCommandOption
- Returns:
- description of an option
-
getType
public org.springframework.core.ResolvableType getType()Description copied from interface:CommandOption
Gets aResolvableType
of an option.- Specified by:
getType
in interfaceCommandOption
- Returns:
- type of an option
-
isRequired
public boolean isRequired()Description copied from interface:CommandOption
Gets a flag if option is required.- Specified by:
isRequired
in interfaceCommandOption
- Returns:
- the required flag
-
getDefaultValue
Description copied from interface:CommandOption
Gets a default value of an option.- Specified by:
getDefaultValue
in interfaceCommandOption
- Returns:
- the default value
-
getPosition
public int getPosition()Description copied from interface:CommandOption
Gets a positional value.- Specified by:
getPosition
in interfaceCommandOption
- Returns:
- the positional value
-
getArityMin
public int getArityMin()Description copied from interface:CommandOption
Gets a minimum arity.- Specified by:
getArityMin
in interfaceCommandOption
- Returns:
- the minimum arity
-
getArityMax
public int getArityMax()Description copied from interface:CommandOption
Gets a maximum arity.- Specified by:
getArityMax
in interfaceCommandOption
- Returns:
- the maximum arity
-
getLabel
Description copied from interface:CommandOption
Gets a label.- Specified by:
getLabel
in interfaceCommandOption
- Returns:
- the label
-
getCompletion
Description copied from interface:CommandOption
Gets a completion function.- Specified by:
getCompletion
in interfaceCommandOption
- Returns:
- the completion function
-