Class NamespacedKeyArgument.Builder<C>
java.lang.Object
cloud.commandframework.arguments.CommandArgument.Builder<C,T>
cloud.commandframework.arguments.CommandArgument.TypedBuilder<C,org.bukkit.NamespacedKey,NamespacedKeyArgument.Builder<C>>
cloud.commandframework.bukkit.argument.NamespacedKeyArgument.Builder<C>
- Type Parameters:
C- sender type
- Enclosing class:
- NamespacedKeyArgument<C>
public static final class NamespacedKeyArgument.Builder<C>
extends cloud.commandframework.arguments.CommandArgument.TypedBuilder<C,org.bukkit.NamespacedKey,NamespacedKeyArgument.Builder<C>>
Builder for
NamespacedKeyArgument.- Since:
- 1.7.0
-
Method Summary
Modifier and TypeMethodDescriptionasOptionalWithDefault(org.bukkit.NamespacedKey defaultValue) Sets the command argument to be optional, with the specified default value.@NonNull NamespacedKeyArgument<C>build()defaultNamespace(String defaultNamespace) Sets a custom default namespace.Set to require explicit namespaces (i.e.requireExplicitNamespace(boolean requireExplicitNamespace) Sets whether to require explicit namespaces (i.e.Methods inherited from class cloud.commandframework.arguments.CommandArgument.TypedBuilder
asOptional, asOptionalWithDefault, asRequired, manager, self, withParser, withSuggestionsProviderMethods inherited from class cloud.commandframework.arguments.CommandArgument.Builder
getDefaultDescription, getDefaultValue, getName, getParser, getSuggestionsProvider, getValueType, isRequired, withDefaultDescription
-
Method Details
-
requireExplicitNamespace
Set to require explicit namespaces (i.e. 'test' will be rejected but 'test:test' will pass).- Returns:
- this builder
- Since:
- 1.7.0
-
requireExplicitNamespace
Sets whether to require explicit namespaces (i.e. 'test' will be rejected but 'test:test' will pass).- Parameters:
requireExplicitNamespace- whether to require explicit namespaces- Returns:
- this builder
- Since:
- 1.7.0
-
defaultNamespace
Sets a custom default namespace. By default, it isNamespacedKey.MINECRAFT.- Parameters:
defaultNamespace- default namespace- Returns:
- this builder
- Since:
- 1.7.0
-
asOptionalWithDefault
public NamespacedKeyArgument.Builder<C> asOptionalWithDefault(org.bukkit.NamespacedKey defaultValue) Sets the command argument to be optional, with the specified default value.- Parameters:
defaultValue- default value- Returns:
- this builder
- Since:
- 1.7.0
- See Also:
-
CommandArgument.Builder.asOptionalWithDefault(String)
-
build
- Overrides:
buildin classcloud.commandframework.arguments.CommandArgument.Builder<C,org.bukkit.NamespacedKey>
-