Modifier and Type | Field and Description |
---|---|
protected Converter<T> |
converter
The converter to use to create the value.
|
protected Class<T> |
type
The type of the argument.
|
argName, DEFAULT_ARG_NAME, defaultValue, description, hidden, index, multiValued, required
Constructor and Description |
---|
TypedArgument()
Creates an empty instance of
TypedArgument . |
TypedArgument(TypedArgument<T> arg)
Creates a new instance of
TypedArgument by copying the state of another TypedArgument . |
Modifier and Type | Method and Description |
---|---|
void |
ensureValidity()
Checks whether or not the argument configuration is valid.
|
Converter<T> |
getConverter() |
Class<T> |
getType() |
TypedArgument<T> |
setArgName(String argName)
Sets the argument name of this
Argument . |
TypedArgument<T> |
setConverter(Converter<T> converter)
Sets the converter used to create the value.
|
TypedArgument<T> |
setDefaultValue(String defaultValue)
Sets the default value of this
Argument . |
TypedArgument<T> |
setDescription(String description)
Sets the description of the
Argument . |
TypedArgument<T> |
setHidden(boolean hidden)
Sets whether or not the current
Argument is hidden. |
TypedArgument<T> |
setIndex(int index)
Sets the argument index.
|
TypedArgument<T> |
setMultiValued(boolean multiValued)
Sets whether or not the argument can receive several values.
|
TypedArgument<T> |
setRequired(boolean required)
Sets whether or not the current
Argument is required. |
TypedArgument<T> |
setType(Class<T> type)
Sets the argument type.
|
getArgName, getDefaultValue, getDescription, getIndex, isHidden, isMultiValued, isRequired, toJson
public TypedArgument(TypedArgument<T> arg)
TypedArgument
by copying the state of another TypedArgument
.arg
- the copied argumentpublic TypedArgument()
TypedArgument
.public TypedArgument<T> setType(Class<T> type)
type
- the typeTypedArgument
instancepublic Converter<T> getConverter()
null
if not setpublic TypedArgument<T> setConverter(Converter<T> converter)
converter
- the converterTypedArgument
instancepublic void ensureValidity()
IllegalArgumentException
.ensureValidity
in class Argument
public TypedArgument<T> setArgName(String argName)
Argument
Argument
.setArgName
in class Argument
argName
- the argument name, must not be null
Argument
instancepublic TypedArgument<T> setDefaultValue(String defaultValue)
Argument
Argument
.setDefaultValue
in class Argument
defaultValue
- the default valueArgument
instancepublic TypedArgument<T> setDescription(String description)
Argument
Argument
.setDescription
in class Argument
description
- the descriptionArgument
instancepublic TypedArgument<T> setHidden(boolean hidden)
Argument
Argument
is hidden.public TypedArgument<T> setIndex(int index)
Argument
public TypedArgument<T> setRequired(boolean required)
Argument
Argument
is required.setRequired
in class Argument
required
- true
to make this argument mandatory, false
otherwiseArgument
instancepublic TypedArgument<T> setMultiValued(boolean multiValued)
Argument
setMultiValued
in class Argument
multiValued
- true
to mark this argument as multi-valued.Argument
instanceCopyright © 2023 Eclipse. All rights reserved.