Class Args
- java.lang.Object
-
- org.spongepowered.asm.mixin.injection.invoke.arg.Args
-
public abstract class Args extends java.lang.ObjectArgument bundle class used inModifyArgscallbacks. See the documentation forModifyArgsfor 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
All Methods Instance Methods Abstract Methods Concrete Methods 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.
-
-
-
Method Detail
-
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
-
-