Package org.junit.jupiter.params.support
Interface ParameterDeclarations
-
- All Known Implementing Classes:
ResolverFacade.DefaultParameterDeclarations
@API(status=MAINTAINED, since="5.13.3") public interface ParameterDeclarationsParameterDeclarationsencapsulates the combined declarations of all indexed@ParameterizedClassor@ParameterizedTestparameters.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
ArgumentsAccessoror parameters annotated with@AggregateWith, are not indexed and thus not included in the list of parameter declarations.- Since:
- 5.13
- See Also:
ParameterDeclaration,ParameterizedClass,ParameterizedTest
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<ParameterDeclaration>get(int parameterIndex){@return the indexed parameter declaration for the supplied index, if available; never {@code null}}java.util.List<ParameterDeclaration>getAll(){@return all indexed parameter declarations; never {@code null}, sorted by index}java.util.Optional<ParameterDeclaration>getFirst(){@return the first indexed parameter declaration, if available; never {@code null}}java.lang.reflect.AnnotatedElementgetSourceElement(){@return the source element of all parameter declarations}java.lang.StringgetSourceElementDescription(){@return a human-readable description of the source element}
-
-
-
Method Detail
-
getAll
java.util.List<ParameterDeclaration> getAll()
{@return all indexed parameter declarations; never {@code null}, sorted by index}
-
getFirst
java.util.Optional<ParameterDeclaration> getFirst()
{@return the first indexed parameter declaration, if available; never {@code null}}
-
get
java.util.Optional<ParameterDeclaration> get(int parameterIndex)
{@return the indexed parameter declaration for the supplied index, if available; never {@code null}}
-
getSourceElement
java.lang.reflect.AnnotatedElement getSourceElement()
{@return 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.
-
getSourceElementDescription
java.lang.String getSourceElementDescription()
{@return a human-readable description of the source element}This may, for example, be used in error messages.
- See Also:
getSourceElement()
-
-