Class ParameterModel
java.lang.Object
io.github.projectunified.craftcommand.processor.model.ParameterModel
Model representing a command method parameter.
-
Constructor Summary
ConstructorsConstructorDescriptionParameterModel(String name, TypeMirror type, boolean greedy, boolean optional, String defaultValue, String suggestProvider, VariableElement element) Constructs a ParameterModel. -
Method Summary
Modifier and TypeMethodDescriptionGets the default value string.Gets the underlying VariableElement.getName()Gets the parameter name.Gets the custom suggestion provider method name.getType()Gets the Java TypeMirror of this parameter.booleanisGreedy()Checks if this parameter is greedy.booleanChecks if this parameter is optional.
-
Constructor Details
-
ParameterModel
public ParameterModel(String name, TypeMirror type, boolean greedy, boolean optional, String defaultValue, String suggestProvider, VariableElement element) Constructs a ParameterModel.- Parameters:
name- the parameter name (from@Nameor reflection)type- the Java type of the parametergreedy-trueif marked with@Greedyoptional-trueif marked with@OptionaldefaultValue- the default value string when optional, ornullsuggestProvider- the custom suggest provider method name, ornullelement- the underlying VariableElement
-
-
Method Details
-
getName
Gets the parameter name.- Returns:
- the parameter name
-
getType
Gets the Java TypeMirror of this parameter.- Returns:
- the parameter type
-
isGreedy
public boolean isGreedy()Checks if this parameter is greedy.- Returns:
trueif greedy
-
isOptional
public boolean isOptional()Checks if this parameter is optional.- Returns:
trueif optional
-
getDefaultValue
Gets the default value string.- Returns:
- the default value, or
null
-
getSuggestProvider
Gets the custom suggestion provider method name.- Returns:
- the suggestion provider name, or
null
-
getElement
Gets the underlying VariableElement.- Returns:
- the variable element
-