Class DurationArgument.Builder<C>
java.lang.Object
cloud.commandframework.arguments.CommandArgument.Builder<C,T>
cloud.commandframework.arguments.CommandArgument.TypedBuilder<C,Duration,DurationArgument.Builder<C>>
cloud.commandframework.arguments.standard.DurationArgument.Builder<C>
- Type Parameters:
C
- sender type
- Enclosing class:
- DurationArgument<C>
@API(status=STABLE,
since="1.7.0")
public static final class DurationArgument.Builder<C>
extends CommandArgument.TypedBuilder<C,Duration,DurationArgument.Builder<C>>
Builder for
DurationArgument
.- Since:
- 1.7.0
-
Method Summary
Modifier and TypeMethodDescription@NonNull DurationArgument.Builder<C>
asOptionalWithDefault
(@NonNull Duration defaultValue) Sets the command argument to be optional, with the specified default value.@NonNull DurationArgument<C>
build()
Create a newDurationArgument
from this builder.Methods inherited from class cloud.commandframework.arguments.CommandArgument.TypedBuilder
asOptional, asOptionalWithDefault, asRequired, manager, self, withParser, withSuggestionsProvider
Methods inherited from class cloud.commandframework.arguments.CommandArgument.Builder
getDefaultDescription, getDefaultValue, getName, getParser, getSuggestionsProvider, getValueType, isRequired, withDefaultDescription
-
Method Details
-
asOptionalWithDefault
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:
-
build
Create a newDurationArgument
from this builder.- Overrides:
build
in classCommandArgument.Builder<C,
Duration> - Returns:
- built argument
- Since:
- 1.7.0
-