Package org.jboss.jandex
Class MethodParameterInfo
java.lang.Object
org.jboss.jandex.MethodParameterInfo
- All Implemented Interfaces:
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.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jboss.jandex.AnnotationTarget
AnnotationTarget.Kind
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal ClassInfo
asClass()
Casts and returns this target as aClassInfo
if it is of kindCLASS
final FieldInfo
asField()
Casts and returns this target as aFieldInfo
if it is of kindFIELD
final MethodInfo
asMethod()
Casts and returns this target as aMethodInfo
if it is of kindMETHOD
final MethodParameterInfo
Casts and returns this target as aMethodParameterInfo
if it is of kindMETHOD_PARAMETER
Casts and returns this target as aRecordComponentInfo
if it is of kindRECORD_COMPONENT
final TypeTarget
asType()
Casts and returns this target as aTypeTarget
if it is of kindTYPE
static MethodParameterInfo
create
(MethodInfo method, short parameter) Constructs a new mock method parameter infoboolean
int
hashCode()
kind()
Returns the kind of object this target represents.final MethodInfo
method()
Returns the method this parameter belongs to.final String
name()
Returns the name of this parameter.final short
position()
Returns the 0 based position of this parameter.toString()
Returns a string representation describing this method parameter
-
Field Details
-
method
-
parameter
private final short parameter
-
-
Constructor Details
-
MethodParameterInfo
MethodParameterInfo(MethodInfo method, short parameter)
-
-
Method Details
-
create
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
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
Returns the name of this parameter.- Returns:
- the name of this parameter.
-
toString
Returns a string representation describing this method parameter -
asClass
Description copied from interface:AnnotationTarget
Casts and returns this target as aClassInfo
if it is of kindCLASS
- Specified by:
asClass
in interfaceAnnotationTarget
- Returns:
- this instance cast to a class
-
asField
Description copied from interface:AnnotationTarget
Casts and returns this target as aFieldInfo
if it is of kindFIELD
- Specified by:
asField
in interfaceAnnotationTarget
- Returns:
- this instance cast to a field
-
asMethod
Description copied from interface:AnnotationTarget
Casts and returns this target as aMethodInfo
if it is of kindMETHOD
- Specified by:
asMethod
in interfaceAnnotationTarget
- Returns:
- this instance cast to a method
-
asMethodParameter
Description copied from interface:AnnotationTarget
Casts and returns this target as aMethodParameterInfo
if it is of kindMETHOD_PARAMETER
- Specified by:
asMethodParameter
in interfaceAnnotationTarget
- Returns:
- this instance cast to a method parameter
-
asType
Description copied from interface:AnnotationTarget
Casts and returns this target as aTypeTarget
if it is of kindTYPE
- Specified by:
asType
in interfaceAnnotationTarget
- Returns:
- this instance cast to a type target
-
asRecordComponent
Description copied from interface:AnnotationTarget
Casts and returns this target as aRecordComponentInfo
if it is of kindRECORD_COMPONENT
- Specified by:
asRecordComponent
in interfaceAnnotationTarget
- Returns:
- this instance cast to a record component
-
kind
Description copied from interface:AnnotationTarget
Returns the kind of object this target represents.- Specified by:
kind
in interfaceAnnotationTarget
- Returns:
- the target kind.
-
hashCode
public int hashCode() -
equals
-