public final class MethodParameterInfo extends java.lang.Object implements AnnotationTarget
Thread-Safety
This class is immutable and can be shared between threads without safe publication.AnnotationTarget.Kind
Modifier and Type | Field and Description |
---|---|
private MethodInfo |
method |
private short |
parameter |
Constructor and Description |
---|
MethodParameterInfo(MethodInfo method,
short parameter) |
Modifier and Type | Method and Description |
---|---|
ClassInfo |
asClass()
Casts and returns this target as a
ClassInfo if it is of kind CLASS |
FieldInfo |
asField()
Casts and returns this target as a
FieldInfo if it is of kind FIELD |
MethodInfo |
asMethod()
Casts and returns this target as a
MethodInfo if it is of kind METHOD |
MethodParameterInfo |
asMethodParameter()
Casts and returns this target as a
MethodParameterInfo if it is of kind METHOD_PARAMETER |
TypeTarget |
asType()
Casts and returns this target as a
TypeTarget if it is of kind TYPE |
static MethodParameterInfo |
create(MethodInfo method,
short parameter)
Constructs a new mock method parameter info
|
AnnotationTarget.Kind |
kind()
Returns the kind of object this target represents.
|
MethodInfo |
method()
Returns the method this parameter belongs to.
|
java.lang.String |
name()
Returns the name of this parameter.
|
short |
position()
Returns the 0 based position of this parameter.
|
java.lang.String |
toString()
Returns a string representation describing this method parameter
|
private final MethodInfo method
private final short parameter
MethodParameterInfo(MethodInfo method, short parameter)
public static MethodParameterInfo create(MethodInfo method, short parameter)
method
- the method containing this parameter.parameter
- the zero based index of this parameterpublic final MethodInfo method()
public final short position()
public final java.lang.String name()
public java.lang.String toString()
toString
in class java.lang.Object
public final ClassInfo asClass()
AnnotationTarget
ClassInfo
if it is of kind CLASS
asClass
in interface AnnotationTarget
public final FieldInfo asField()
AnnotationTarget
FieldInfo
if it is of kind FIELD
asField
in interface AnnotationTarget
public final MethodInfo asMethod()
AnnotationTarget
MethodInfo
if it is of kind METHOD
asMethod
in interface AnnotationTarget
public final MethodParameterInfo asMethodParameter()
AnnotationTarget
MethodParameterInfo
if it is of kind METHOD_PARAMETER
asMethodParameter
in interface AnnotationTarget
public final TypeTarget asType()
AnnotationTarget
TypeTarget
if it is of kind TYPE
asType
in interface AnnotationTarget
public AnnotationTarget.Kind kind()
AnnotationTarget
kind
in interface AnnotationTarget