Class MiddlewareCallbackInfo
java.lang.Object
de.craftsblock.craftsnet.api.middlewares.MiddlewareCallbackInfo
The
MiddlewareCallbackInfo is used to pass information between the different
middlewares. It can further more also affect the further behaviour
of the invoker after the invocation of the middlewares.- Since:
- 3.4.0-SNAPSHOT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the custom cancel reason which was set by one of the listeners.booleanChecks and returns whether a custom cancel reason was set by one of the listeners.booleanChecks if the callback has been cancelled.voidsetCancelled(boolean cancelled) Sets the cancelled flag for the callback, indicating whether the callback is cancelled or not.voidsetCancelReason(String cancelReason) Sets a custom cancel reason which is printed to the console
-
Constructor Details
-
MiddlewareCallbackInfo
public MiddlewareCallbackInfo()
-
-
Method Details
-
setCancelled
public void setCancelled(boolean cancelled) Sets the cancelled flag for the callback, indicating whether the callback is cancelled or not.- Parameters:
cancelled-trueto cancel the callback,falseto allow processing.
-
isCancelled
public boolean isCancelled()Checks if the callback has been cancelled.- Returns:
trueif the callback is cancelled,falseotherwise.
-
setCancelReason
Sets a custom cancel reason which is printed to the console- Parameters:
cancelReason- The cancel reason which is printed to the console
-
getCancelReason
Gets the custom cancel reason which was set by one of the listeners.- Returns:
- The cancel reason
-
hasCancelReason
public boolean hasCancelReason()Checks and returns whether a custom cancel reason was set by one of the listeners.- Returns:
- true if a custom cancel reason was set, false otherwise.
-