Package org.spongepowered.api.command
Interface CommandResult.Builder
-
- All Superinterfaces:
Buildable.Builder<CommandResult>
,Builder<CommandResult,CommandResult.Builder>
,ResettableBuilder<CommandResult,CommandResult.Builder>
- Enclosing interface:
- CommandResult
public static interface CommandResult.Builder extends Builder<CommandResult,CommandResult.Builder>
BuildsCommandResult
s.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CommandResult
build()
Builds theCommandResult
.CommandResult.Builder
error(@Nullable Component errorMessage)
Sets the built result to report an error, with an optional error message.CommandResult.Builder
result(int result)
Sets an integer value that indicates the states of the command.
-
-
-
Method Detail
-
result
CommandResult.Builder result(int 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
CommandResult.Builder error(@Nullable Component errorMessage)
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 interfaceBuildable.Builder<CommandResult>
- Returns:
- A CommandResult with the specified settings
-
-