Class CommandArgument
java.lang.Object
dev.ua.theroer.magicutils.commands.CommandArgument
Represents a command argument with its properties and permission
requirements.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for CommandArgument. -
Method Summary
Modifier and TypeMethodDescriptionstatic CommandArgument.BuilderCreates a builder for CommandArgument.Allowed sender kinds for this parameter.Returns the names of arguments whose parsed values should be available when generating suggestions.Long option names without "--" prefix.String[]Names of arguments participating in the permission condition.Short option names without "-" prefix.Available suggestions for this argument.booleanChecks if argument has permission.booleanChecks if argument has permission condition.booleanhasSuggestion(String suggestion) Checks if argument contains specific suggestion.booleanisFlag()Returns true if this option is a flag (no value required).booleanisOption()Returns true if this argument supports named options.toString()
-
Method Details
-
hasPermission
public boolean hasPermission()Checks if argument has permission.- Returns:
- true if permission is set
-
getAllowedSenders
Allowed sender kinds for this parameter.- Returns:
- array of allowed senders
-
isOption
public boolean isOption()Returns true if this argument supports named options.- Returns:
- true when option names are defined
-
isFlag
public boolean isFlag()Returns true if this option is a flag (no value required).- Returns:
- true if flag
-
getShortOptionNames
-
getLongOptionNames
-
getContextArgs
-
hasPermissionCondition
public boolean hasPermissionCondition()Checks if argument has permission condition.- Returns:
- true if permission condition is set
-
getPermissionConditionArgs
Names of arguments participating in the permission condition.- Returns:
- array of argument names
-
hasSuggestion
Checks if argument contains specific suggestion.- Parameters:
suggestion- the suggestion to check- Returns:
- true if suggestion exists
-
getSuggestions
-
builder
Creates a builder for CommandArgument.- Parameters:
name- the argument nametype- the argument type- Returns:
- a new Builder instance
-
toString
-