java.lang.Object
org.spongepowered.asm.mixin.injection.invoke.arg.Args

public abstract class Args extends 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 final Object[]
    Argument values
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Args(Object[] values)
    Ctor.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    get(int index)
    Retrieve the argument value at the specified index
    abstract <T> void
    set(int index, T value)
    Set (modify) the specified argument value.
    abstract void
    setAll(Object... values)
    Set (modify) all argument values.
    int
    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 Object[] values
      Argument values
  • Constructor Details

    • Args

      protected Args(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:
      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 set
      value - Argument value
      Throws:
      ArgumentIndexOutOfBoundsException - if the specified argument index is outside the range of available arguments
    • setAll

      public abstract void setAll(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. See set(int, Object) for details.
      Parameters:
      values - Argument values to set