Interface ParameterDeclarations
ParameterDeclarations encapsulates the combined declarations
of all indexed @ParameterizedClass or
@ParameterizedTest parameters.
For a @ParameterizedTest, the parameter declarations are derived
from the method signature. For a @ParameterizedClass, they may be
derived from the constructor or
@Parameter-annotated fields.
Aggregators, that is parameters of type
ArgumentsAccessor or parameters annotated with
@AggregateWith, are
not indexed and thus not included in the list of parameter
declarations.
- Since:
- 5.13
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionget(int parameterIndex) Returns the indexed parameter declaration for the supplied index, if available; nevernull.getAll()Returns all indexed parameter declarations; nevernull, sorted by index.getFirst()Returns the first indexed parameter declaration, if available; nevernull.Returns the source element of all parameter declarations.Returns a human-readable description of the source element.
-
Method Details
-
getAll
List<ParameterDeclaration> getAll()Returns all indexed parameter declarations; nevernull, sorted by index.- Returns:
- all indexed parameter declarations; never
null, sorted by index
-
getFirst
Optional<ParameterDeclaration> getFirst()Returns the first indexed parameter declaration, if available; nevernull.- Returns:
- the first indexed parameter declaration, if available;
never
null
-
get
Returns the indexed parameter declaration for the supplied index, if available; nevernull.- Returns:
- the indexed parameter declaration for the supplied
index, if available; never
null
-
getSourceElement
AnnotatedElement getSourceElement()Returns the source element of all parameter declarations.For
@ParameterizedTest, this always corresponds to the parameterized test method. For@ParameterizedClass, this corresponds to the parameterized test class constructor, if constructor injection is used; or the test class itself, if field injection is used.- Returns:
- the source element of all parameter declarations
-
getSourceElementDescription
String getSourceElementDescription()Returns a human-readable description of the source element.This may, for example, be used in error messages.
- Returns:
- a human-readable description of the source element
- See Also:
-