class RepetitionInfoParameterResolver extends java.lang.Object implements ParameterResolver
Modifier and Type | Class and Description |
---|---|
private static class |
RepetitionInfoParameterResolver.DefaultRepetitionInfo |
Modifier and Type | Field and Description |
---|---|
private int |
currentRepetition |
private int |
totalRepetitions |
Constructor and Description |
---|
RepetitionInfoParameterResolver(int currentRepetition,
int totalRepetitions) |
Modifier and Type | Method and Description |
---|---|
RepetitionInfo |
resolveParameter(ParameterContext parameterContext,
ExtensionContext extensionContext)
Resolve an argument for the
Parameter in the supplied ParameterContext
for the supplied ExtensionContext . |
boolean |
supportsParameter(ParameterContext parameterContext,
ExtensionContext extensionContext)
Determine if this resolver supports resolution of an argument for the
Parameter in the supplied ParameterContext for the supplied
ExtensionContext . |
private final int currentRepetition
private final int totalRepetitions
public RepetitionInfoParameterResolver(int currentRepetition, int totalRepetitions)
public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext)
ParameterResolver
Parameter
in the supplied ParameterContext
for the supplied
ExtensionContext
.
The Method
or Constructor
in which the parameter is declared can be retrieved via
ParameterContext.getDeclaringExecutable()
.
supportsParameter
in interface ParameterResolver
parameterContext
- the context for the parameter for which an argument should
be resolved; never null
extensionContext
- the extension context for the Executable
about to be invoked; never null
true
if this resolver can resolve an argument for the parameterParameterResolver.resolveParameter(org.junit.jupiter.api.extension.ParameterContext, org.junit.jupiter.api.extension.ExtensionContext)
,
ParameterContext
public RepetitionInfo resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext)
ParameterResolver
Parameter
in the supplied ParameterContext
for the supplied ExtensionContext
.
This method is only called by the framework if ParameterResolver.supportsParameter(org.junit.jupiter.api.extension.ParameterContext, org.junit.jupiter.api.extension.ExtensionContext)
previously returned true
for the same ParameterContext
and ExtensionContext
.
The Method
or Constructor
in which the parameter is declared can be retrieved via
ParameterContext.getDeclaringExecutable()
.
resolveParameter
in interface ParameterResolver
parameterContext
- the context for the parameter for which an argument should
be resolved; never null
extensionContext
- the extension context for the Executable
about to be invoked; never null
null
if the
parameter type is not a primitiveParameterResolver.supportsParameter(org.junit.jupiter.api.extension.ParameterContext, org.junit.jupiter.api.extension.ExtensionContext)
,
ParameterContext