class DefaultParameterContext extends java.lang.Object implements ParameterContext
Modifier and Type | Field and Description |
---|---|
private int |
index |
private java.lang.reflect.Parameter |
parameter |
private java.util.Optional<java.lang.Object> |
target |
Constructor and Description |
---|
DefaultParameterContext(java.lang.reflect.Parameter parameter,
int index,
java.util.Optional<java.lang.Object> target) |
Modifier and Type | Method and Description |
---|---|
int |
getIndex()
Get the index of the
Parameter for this context within the
parameter list of the Executable that
declares the parameter. |
java.lang.reflect.Parameter |
getParameter()
Get the
Parameter for this context. |
java.util.Optional<java.lang.Object> |
getTarget()
Get the target on which the
Executable
that declares the Parameter for this context will
be invoked, if available. |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDeclaringExecutable
private final java.lang.reflect.Parameter parameter
private final int index
private final java.util.Optional<java.lang.Object> target
DefaultParameterContext(java.lang.reflect.Parameter parameter, int index, java.util.Optional<java.lang.Object> target)
public java.lang.reflect.Parameter getParameter()
ParameterContext
Parameter
for this context.getParameter
in interface ParameterContext
null
ParameterContext.getIndex()
public int getIndex()
ParameterContext
Parameter
for this context within the
parameter list of the Executable
that
declares the parameter.getIndex
in interface ParameterContext
ParameterContext.getParameter()
,
Executable.getParameters()
public java.util.Optional<java.lang.Object> getTarget()
ParameterContext
Executable
that declares the Parameter
for this context will
be invoked, if available.getTarget
in interface ParameterContext
Optional
containing the target on which the
Executable
will be invoked; never null
but will be
empty if the Executable
is a constructor or a
static
method.public java.lang.String toString()
toString
in class java.lang.Object