-
- All Implemented Interfaces:
-
java.lang.Comparable
public abstract class XC_MethodReplacement extends XC_MethodHook
A special case of XC_MethodHook which completely replaces the original method.
-
-
Field Summary
Fields Modifier and Type Field Description public final static XC_MethodReplacementDO_NOTHING
-
Constructor Summary
Constructors Constructor Description XC_MethodReplacement()Creates a new callback with default priority. XC_MethodReplacement(int priority)Creates a new callback with a specific priority.
-
Method Summary
Modifier and Type Method Description static XC_MethodReplacementreturnConstant(Object result)Creates a callback which always returns a specific value. static XC_MethodReplacementreturnConstant(int priority, Object result)Like returnConstant, but allows to specify a priority for the callback. -
-
Constructor Detail
-
XC_MethodReplacement
XC_MethodReplacement()
Creates a new callback with default priority.
-
XC_MethodReplacement
XC_MethodReplacement(int priority)
Creates a new callback with a specific priority.- Parameters:
priority- See priority.
-
-
Method Detail
-
returnConstant
static XC_MethodReplacement returnConstant(Object result)
Creates a callback which always returns a specific value.
- Parameters:
result- The value that should be returned to callers of the hooked method.
-
returnConstant
static XC_MethodReplacement returnConstant(int priority, Object result)
Like returnConstant, but allows to specify a priority for the callback.
- Parameters:
priority- See priority.result- The value that should be returned to callers of the hooked method.
-
-
-
-