A - The actor typepublic interface Potential<A extends CommandActor> extends java.lang.Comparable<Potential<A>>
ExecutableCommand
with some MutableStringStream input.
This attempt may either be successful, or failed with an error (Throwable).
Note that this will send no feedback at all to the user. It can continue execution
with execute() or handle the exception with handleException().
| Modifier and Type | Method and Description |
|---|---|
@NotNull ExecutionContext<A> |
context()
Returns the
ExecutionContext generated from the execution
attempt, as well as any values parsed from the input. |
@Nullable java.lang.Throwable |
error()
Returns the error generated from the execution attempt.
|
@Nullable ErrorContext<A> |
errorContext()
Returns the context in which the error has occurred.
|
void |
execute()
Executes the command.
|
boolean |
failed()
Tests whether the execution failed or not
|
void |
handleException()
Handles the exception that caused the attempt to fail.
|
boolean |
successful()
Tests whether the execution was successful or not
|
boolean successful()
boolean failed()
@NotNull @NotNull ExecutionContext<A> context()
ExecutionContext generated from the execution
attempt, as well as any values parsed from the input.@Nullable @Nullable java.lang.Throwable error()
successful(), this will be null.@Nullable @Nullable ErrorContext<A> errorContext()
For example, if the error was because a parameter was invalid, this
will be a ErrorContext.ParsingParameter context,
which contains information about the parameter being parsed.
If, however, it occurred during executing the command function,
this will be an ErrorContext.ExecutingFunction context.
null if this was
successfulvoid handleException()
If the attempt was successful, this method will do nothing
void execute()
If the attempt was not successful, this method will do nothing