public class InjectionCallback
extends java.lang.Object
CInject transformer.| Constructor and Description |
|---|
InjectionCallback(boolean cancellable) |
InjectionCallback(boolean cancellable,
java.lang.Object returnValue) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
castReturnValue() |
java.lang.Object |
getReturnValue() |
boolean |
isCancellable() |
boolean |
isCancelled() |
void |
setCancelled(boolean cancelled)
Set the original method to be cancelled.
|
void |
setReturnValue(java.lang.Object returnValue)
Set the return value of the original method.
This will also set the cancelled state to true. |
public InjectionCallback(boolean cancellable)
public InjectionCallback(boolean cancellable,
@Nullable
java.lang.Object returnValue)
public boolean isCancellable()
public boolean isCancelled()
public void setCancelled(boolean cancelled)
cancelled - If the original method should be cancelledjava.lang.IllegalArgumentException - If the callback is not cancellable@Nullable public java.lang.Object getReturnValue()
@Nullable public <T> T castReturnValue()
T - The wanted typejava.lang.ClassCastException - If the return value is not of the wanted typepublic void setReturnValue(@Nullable
java.lang.Object returnValue)
returnValue - The new return value