Package dev.jorel.commandapi.arguments
Class ListArgumentBuilder<T>
java.lang.Object
dev.jorel.commandapi.arguments.ListArgumentBuilder<T>
- Type Parameters:
T- the type that the list argument generates a list of.
A builder to create a ListArgument
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionListArgumentBuilder(String nodeName) Creates a new ListArgumentBuilder with a specified node name.ListArgumentBuilder(String nodeName, String delimiter) Creates a new ListArgumentBuilder with a specified node name -
Method Summary
Modifier and TypeMethodDescriptionallowDuplicates(boolean allowDuplicates) Whether duplicates are allowed in the provided list.withList(Collection<T> list) Specifies the list to use to generate suggestions for the list argumentwithList(Function<SuggestionInfo<org.bukkit.command.CommandSender>, Collection<T>> list) Specifies the list to use to generate suggestions for the list argumentwithList(Supplier<Collection<T>> list) Specifies the list to use to generate suggestions for the list argumentSpecifies the list to use to generate suggestions for the list argument
-
Constructor Details
-
ListArgumentBuilder
Creates a new ListArgumentBuilder with a specified node name. Defaults the delimiter for each element in the list to a space- Parameters:
nodeName- the name of the node for this argument
-
ListArgumentBuilder
-
-
Method Details
-
allowDuplicates
Whether duplicates are allowed in the provided list. By default, duplicates are not allowed.- Parameters:
allowDuplicates- whether to enable duplicates or not- Returns:
- this list argument builder
-
withList
public ListArgumentBuilder<T>.ListArgumentBuilderSuggests withList(Function<SuggestionInfo<org.bukkit.command.CommandSender>, Collection<T>> list) Specifies the list to use to generate suggestions for the list argument- Parameters:
list- a function that accepts aSuggestionInfoand returns a collection of elements to suggest for this list argument- Returns:
- this list argument builder
-
withList
Specifies the list to use to generate suggestions for the list argument- Parameters:
list- a supplier that returns a collection of elements to suggest for this list argument- Returns:
- this list argument builder
-
withList
Specifies the list to use to generate suggestions for the list argument- Parameters:
list- a collection of elements to suggest for this list argument- Returns:
- this list argument builder
-
withList
Specifies the list to use to generate suggestions for the list argument- Parameters:
array- an array of elements to suggest for this list argument- Returns:
- this list argument builder
-