Package org.spongepowered.api.command
Interface CommandResult.Builder
- All Superinterfaces:
AbstractBuilder<CommandResult>
,Builder<CommandResult,
,CommandResult.Builder> ResettableBuilder<CommandResult,
CommandResult.Builder>
- Enclosing interface:
- CommandResult
Builds
CommandResult
s.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds theCommandResult
.Sets the built result to report an error, with an optional error message.result
(int result) Sets an integer value that indicates the states of the command.
-
Method Details
-
result
Sets an integer value that indicates the states of the command.- A positive value indicates successful execution,
- Zero (generally) indicates the command didn't fulfil its task, though that is not necessarily an error condition.
- A negative value is undefined in the API, if returned, the effects are implementation specific.
- Parameters:
result
- The integer result to set- Returns:
- This builder, for chaining
-
error
Sets the built result to report an error, with an optional error message.If this is set, then the command parser will send this message to the command invoker. Otherwise, the parser will report an unknown exception.
- Parameters:
errorMessage
- The message to send to the user.- Returns:
- This builder, for chaining
-
build
CommandResult build()Builds theCommandResult
.- Specified by:
build
in interfaceAbstractBuilder<CommandResult>
- Returns:
- A CommandResult with the specified settings
-