Class Args
java.lang.Object
org.spongepowered.asm.mixin.injection.invoke.arg.Args
public abstract class Args
extends java.lang.Object
Argument bundle class used in
ModifyArgs callbacks. See the
documentation for ModifyArgs for details. Synthetic subclasses are
generated at runtime for specific injectors.-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Object[]valuesArgument values -
Constructor Summary
Constructors Modifier Constructor Description protectedArgs(java.lang.Object[] values)Ctor. -
Method Summary
Modifier and Type Method Description <T> Tget(int index)Retrieve the argument value at the specified indexabstract <T> voidset(int index, T value)Set (modify) the specified argument value.abstract voidsetAll(java.lang.Object... values)Set (modify) all argument values.intsize()Return the argument list size.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
values
protected final java.lang.Object[] valuesArgument values
-
-
Constructor Details
-
Args
protected Args(java.lang.Object[] values)Ctor.- Parameters:
values- argument values
-
-
Method Details
-
size
public int size()Return the argument list size.- Returns:
- number of arguments available
-
get
public <T> T get(int index)Retrieve the argument value at the specified index- Type Parameters:
T- the argument type- Parameters:
index- argument index to retrieve- Returns:
- the argument value
- Throws:
java.lang.ArrayIndexOutOfBoundsException- if a value outside the range of available arguments is accessed
-
set
public abstract <T> void set(int index, T value)Set (modify) the specified argument value. Internal verification is performed upon supplied values and the following requirements are enforced:- Reference types must be assignable to the object type, or can be null.
- Primitive types must match the target types exactly and cannot be null.
- Type Parameters:
T- Argument type- Parameters:
index- Argument index to setvalue- Argument value- Throws:
ArgumentIndexOutOfBoundsException- if the specified argument index is outside the range of available arguments
-
setAll
public abstract void setAll(java.lang.Object... values)Set (modify) all argument values. The number and type of arguments supplied to this method must precisely match the argument types in the bundle. Seeset(int, Object)for details.- Parameters:
values- Argument values to set
-