Class WordArgument
-
- All Implemented Interfaces:
public final class WordArgument
An "argument" representing a word inside a PhraseArgument. This does not function as a usual argument and does not extend AbstractStellarArgument.
-
-
Field Summary
Fields Modifier and Type Field Description private final List<PhraseExecutableExecution<?>>
executions
private final List<PhraseExecutableRunnable<?>>
runnables
private final List<PhraseExecutableSuggestion<?>>
suggestions
-
Constructor Summary
Constructors Constructor Description WordArgument()
-
Method Summary
Modifier and Type Method Description final List<PhraseExecutableExecution<?>>
getExecutions()
final List<PhraseExecutableRunnable<?>>
getRunnables()
final List<PhraseExecutableSuggestion<?>>
getSuggestions()
final WordArgument
addSuggestion(Suggestion suggestion)
Adds a Suggestion on top of the current suggestions. final WordArgument
addSuggestion(String title, String tooltip)
Adds a Suggestion with the given title and tooltip on top of the current suggestions. final <C extends CommandSender> WordArgument
addSuggestion(Function1<PhraseCommandContext<C>, Iterable<Suggestion>> suggestion)
Adds a function that returns a list of Suggestion on top of the current suggestions. final WordArgument
addSuggestion(SimplePhraseSuggestion<CommandSender> suggestion)
Adds a function that returns a list of Suggestion on top of the current suggestions. final WordArgument
addSuggestions(Suggestion suggestions)
Adds multiple Suggestion on top of the current suggestions. final WordArgument
addSuggestions(String suggestions)
Adds multiple Suggestion with the titles defined in suggestions on top of the current suggestions. final WordArgument
setSuggestions(Suggestion suggestions)
Replaces all suggestions with suggestions. final WordArgument
setSuggestions(String suggestions)
Replaces all suggestions with suggestions. final WordArgument
setSuggestions(List<Suggestion> suggestions)
Replaces all suggestions with suggestions. final WordArgument
setSuggestionsWithoutTooltip(List<String> suggestions)
Replaces all suggestions with suggestions. final <C extends CommandSender> WordArgument
setExecution(Function1<PhraseCommandContext<C>, Unit> execution)
Replaces all executions with execution. final WordArgument
setExecution(PhraseExecution<CommandSender> execution)
Replaces all executions with execution. final <C extends CommandSender> WordArgument
addExecution(Function1<PhraseCommandContext<C>, Unit> execution)
Adds an execution on top of the other executions. final WordArgument
addExecution(PhraseExecution<CommandSender> execution)
Adds an execution on top of the other executions. final <C extends CommandSender> WordArgument
addAsyncExecution(Function1<PhraseCommandContext<C>, Unit> execution)
Adds an async execution on top of the other executions. final WordArgument
addAsyncExecution(PhraseExecution<CommandSender> execution)
Adds an async execution on top of the other executions. final <C extends CommandSender> WordArgument
setRunnable(Function1<PhraseCommandContext<C>, Boolean> runnable)
Replaces all runnables with runnable. final WordArgument
setRunnable(PhraseRunnable<CommandSender> runnable)
Replaces all runnables with runnable. final <C extends CommandSender> WordArgument
addRunnable(Function1<PhraseCommandContext<C>, Boolean> runnable)
Adds runnable on top of the other runnables. final WordArgument
addRunnable(PhraseRunnable<CommandSender> runnable)
Adds runnable on top of the other runnables. -
-
Method Detail
-
getExecutions
final List<PhraseExecutableExecution<?>> getExecutions()
-
getRunnables
final List<PhraseExecutableRunnable<?>> getRunnables()
-
getSuggestions
final List<PhraseExecutableSuggestion<?>> getSuggestions()
-
addSuggestion
final WordArgument addSuggestion(Suggestion suggestion)
Adds a Suggestion on top of the current suggestions.
- Returns:
The modified WordArgument instance.
-
addSuggestion
final WordArgument addSuggestion(String title, String tooltip)
Adds a Suggestion with the given title and tooltip on top of the current suggestions.
- Returns:
The modified WordArgument instance.
-
addSuggestion
final <C extends CommandSender> WordArgument addSuggestion(Function1<PhraseCommandContext<C>, Iterable<Suggestion>> suggestion)
Adds a function that returns a list of Suggestion on top of the current suggestions. Only works in Kotlin.
- Returns:
The modified WordArgument instance.
-
addSuggestion
final WordArgument addSuggestion(SimplePhraseSuggestion<CommandSender> suggestion)
Adds a function that returns a list of Suggestion on top of the current suggestions. Only works in Kotlin.
- Returns:
The modified WordArgument instance.
-
addSuggestions
final WordArgument addSuggestions(Suggestion suggestions)
Adds multiple Suggestion on top of the current suggestions.
- Returns:
The modified WordArgument instance.
-
addSuggestions
final WordArgument addSuggestions(String suggestions)
Adds multiple Suggestion with the titles defined in suggestions on top of the current suggestions.
- Returns:
The modified WordArgument instance.
-
setSuggestions
final WordArgument setSuggestions(Suggestion suggestions)
Replaces all suggestions with suggestions.
- Returns:
The modified WordArgument instance.
-
setSuggestions
final WordArgument setSuggestions(String suggestions)
Replaces all suggestions with suggestions. suggestions represents a list of Suggestion without a tooltip.
- Returns:
The modified WordArgument instance.
-
setSuggestions
final WordArgument setSuggestions(List<Suggestion> suggestions)
Replaces all suggestions with suggestions.
- Returns:
The modified WordArgument instance.
-
setSuggestionsWithoutTooltip
final WordArgument setSuggestionsWithoutTooltip(List<String> suggestions)
Replaces all suggestions with suggestions. suggestions represents a list of Suggestion without a tooltip.
- Returns:
The modified WordArgument instance.
-
setExecution
final <C extends CommandSender> WordArgument setExecution(Function1<PhraseCommandContext<C>, Unit> execution)
Replaces all executions with execution. Only works in Kotlin.
- Returns:
The modified WordArgument instance.
-
setExecution
final WordArgument setExecution(PhraseExecution<CommandSender> execution)
Replaces all executions with execution.
- Returns:
The modified WordArgument instance.
-
addExecution
final <C extends CommandSender> WordArgument addExecution(Function1<PhraseCommandContext<C>, Unit> execution)
Adds an execution on top of the other executions. Only works in Kotlin.
- Returns:
The modified WordArgument instance.
-
addExecution
final WordArgument addExecution(PhraseExecution<CommandSender> execution)
Adds an execution on top of the other executions.
- Returns:
The modified WordArgument instance.
-
addAsyncExecution
final <C extends CommandSender> WordArgument addAsyncExecution(Function1<PhraseCommandContext<C>, Unit> execution)
Adds an async execution on top of the other executions. Only works in Kotlin.
- Returns:
The modified WordArgument instance.
-
addAsyncExecution
final WordArgument addAsyncExecution(PhraseExecution<CommandSender> execution)
Adds an async execution on top of the other executions.
- Returns:
The modified WordArgument instance.
-
setRunnable
final <C extends CommandSender> WordArgument setRunnable(Function1<PhraseCommandContext<C>, Boolean> runnable)
Replaces all runnables with runnable. Only works in Kotlin.
- Returns:
The modified WordArgument instance.
-
setRunnable
final WordArgument setRunnable(PhraseRunnable<CommandSender> runnable)
Replaces all runnables with runnable.
- Returns:
The modified WordArgument instance.
-
addRunnable
final <C extends CommandSender> WordArgument addRunnable(Function1<PhraseCommandContext<C>, Boolean> runnable)
Adds runnable on top of the other runnables. Only works in Kotlin.
- Returns:
The modified WordArgument instance.
-
addRunnable
final WordArgument addRunnable(PhraseRunnable<CommandSender> runnable)
Adds runnable on top of the other runnables.
- Returns:
The modified WordArgument instance.
-
-
-
-