Class MethodParameterInfo

java.lang.Object
org.jboss.jandex.MethodParameterInfo
All Implemented Interfaces:
AnnotationTarget

public final class MethodParameterInfo extends Object implements AnnotationTarget
Represents an individual Java method parameter that was annotated.

Thread-Safety

This class is immutable and can be shared between threads without safe publication.
  • Field Details

    • method

      private final MethodInfo method
    • parameter

      private final short parameter
  • Constructor Details

    • MethodParameterInfo

      MethodParameterInfo(MethodInfo method, short parameter)
  • Method Details

    • create

      public static MethodParameterInfo create(MethodInfo method, short parameter)
      Constructs a new mock method parameter info
      Parameters:
      method - the method containing this parameter.
      parameter - the zero based index of this parameter
      Returns:
      the new mock parameter info
    • method

      public final MethodInfo method()
      Returns the method this parameter belongs to.
      Returns:
      the declaring Java method
    • position

      public final short position()
      Returns the 0 based position of this parameter.
      Returns:
      the position of this parameter
    • name

      public final String name()
      Returns the name of this parameter.
      Returns:
      the name of this parameter.
    • toString

      public String toString()
      Returns a string representation describing this method parameter
      Overrides:
      toString in class Object
      Returns:
      a string representation of this parameter
    • asClass

      public final ClassInfo asClass()
      Description copied from interface: AnnotationTarget
      Casts and returns this target as a ClassInfo if it is of kind CLASS
      Specified by:
      asClass in interface AnnotationTarget
      Returns:
      this instance cast to a class
    • asField

      public final FieldInfo asField()
      Description copied from interface: AnnotationTarget
      Casts and returns this target as a FieldInfo if it is of kind FIELD
      Specified by:
      asField in interface AnnotationTarget
      Returns:
      this instance cast to a field
    • asMethod

      public final MethodInfo asMethod()
      Description copied from interface: AnnotationTarget
      Casts and returns this target as a MethodInfo if it is of kind METHOD
      Specified by:
      asMethod in interface AnnotationTarget
      Returns:
      this instance cast to a method
    • asMethodParameter

      public final MethodParameterInfo asMethodParameter()
      Description copied from interface: AnnotationTarget
      Casts and returns this target as a MethodParameterInfo if it is of kind METHOD_PARAMETER
      Specified by:
      asMethodParameter in interface AnnotationTarget
      Returns:
      this instance cast to a method parameter
    • asType

      public final TypeTarget asType()
      Description copied from interface: AnnotationTarget
      Casts and returns this target as a TypeTarget if it is of kind TYPE
      Specified by:
      asType in interface AnnotationTarget
      Returns:
      this instance cast to a type target
    • asRecordComponent

      public RecordComponentInfo asRecordComponent()
      Description copied from interface: AnnotationTarget
      Casts and returns this target as a RecordComponentInfo if it is of kind RECORD_COMPONENT
      Specified by:
      asRecordComponent in interface AnnotationTarget
      Returns:
      this instance cast to a record component
    • kind

      public AnnotationTarget.Kind kind()
      Description copied from interface: AnnotationTarget
      Returns the kind of object this target represents.
      Specified by:
      kind in interface AnnotationTarget
      Returns:
      the target kind.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object