Class CallbackInfoReturnable<R>
java.lang.Object
org.spongepowered.asm.mixin.injection.callback.CallbackInfo
org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable<R>
- Type Parameters:
R- Return type
- All Implemented Interfaces:
Cancellable
public class CallbackInfoReturnable<R> extends CallbackInfo
For callbacks with a non-void return type, a CallbackInfoReturnable is passed
to the callback instead to allow the callback to interact with the method
return value.
-
Constructor Summary
Constructors Constructor Description CallbackInfoReturnable(java.lang.String name, boolean cancellable)CallbackInfoReturnable(java.lang.String name, boolean cancellable, boolean returnValue)CallbackInfoReturnable(java.lang.String name, boolean cancellable, byte returnValue)CallbackInfoReturnable(java.lang.String name, boolean cancellable, char returnValue)CallbackInfoReturnable(java.lang.String name, boolean cancellable, double returnValue)CallbackInfoReturnable(java.lang.String name, boolean cancellable, float returnValue)CallbackInfoReturnable(java.lang.String name, boolean cancellable, int returnValue)CallbackInfoReturnable(java.lang.String name, boolean cancellable, long returnValue)CallbackInfoReturnable(java.lang.String name, boolean cancellable, short returnValue)CallbackInfoReturnable(java.lang.String name, boolean cancellable, R returnValue) -
Method Summary
Modifier and Type Method Description RgetReturnValue()bytegetReturnValueB()chargetReturnValueC()doublegetReturnValueD()floatgetReturnValueF()intgetReturnValueI()longgetReturnValueJ()shortgetReturnValueS()booleangetReturnValueZ()voidsetReturnValue(R returnValue)Sets a return value for this callback and cancels the callback (required in order to return the new value)Methods inherited from class org.spongepowered.asm.mixin.injection.callback.CallbackInfo
cancel, getCallInfoClassName, getId, isCancellable, isCancelled, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
CallbackInfoReturnable
public CallbackInfoReturnable(java.lang.String name, boolean cancellable) -
CallbackInfoReturnable
-
CallbackInfoReturnable
public CallbackInfoReturnable(java.lang.String name, boolean cancellable, byte returnValue) -
CallbackInfoReturnable
public CallbackInfoReturnable(java.lang.String name, boolean cancellable, char returnValue) -
CallbackInfoReturnable
public CallbackInfoReturnable(java.lang.String name, boolean cancellable, double returnValue) -
CallbackInfoReturnable
public CallbackInfoReturnable(java.lang.String name, boolean cancellable, float returnValue) -
CallbackInfoReturnable
public CallbackInfoReturnable(java.lang.String name, boolean cancellable, int returnValue) -
CallbackInfoReturnable
public CallbackInfoReturnable(java.lang.String name, boolean cancellable, long returnValue) -
CallbackInfoReturnable
public CallbackInfoReturnable(java.lang.String name, boolean cancellable, short returnValue) -
CallbackInfoReturnable
public CallbackInfoReturnable(java.lang.String name, boolean cancellable, boolean returnValue)
-
-
Method Details
-
setReturnValue
Sets a return value for this callback and cancels the callback (required in order to return the new value)- Parameters:
returnValue- value to return- Throws:
CancellationException
-
getReturnValue
-
getReturnValueB
public byte getReturnValueB() -
getReturnValueC
public char getReturnValueC() -
getReturnValueD
public double getReturnValueD() -
getReturnValueF
public float getReturnValueF() -
getReturnValueI
public int getReturnValueI() -
getReturnValueJ
public long getReturnValueJ() -
getReturnValueS
public short getReturnValueS() -
getReturnValueZ
public boolean getReturnValueZ()
-