Annotation Interface Argument.Index

Enclosing class:
Argument

@Retention(RUNTIME) @Target(METHOD) public static @interface Argument.Index
Reads the argument at the given index of the constructor or factory call that produced the value. Paired with Method.Calls or Method.Chain, reads it from the matched call instead.
// new Color(255, 128, 0)
@Argument.Index(1)
Integer green();

If the return type is a conduit and the argument at that index doesn't match it, the arguments starting there are regrouped to fit the return type's own Argument.Index methods. That covers a class flattening another class's fields into its constructor.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    int
    The index of the argument to read.
  • Element Details

    • value

      int value
      The index of the argument to read.
      Returns:
      the argument index, counted from zero