Interface ParameterDeclarations

  • All Known Implementing Classes:
    ResolverFacade.DefaultParameterDeclarations

    @API(status=MAINTAINED,
         since="5.13.3")
    public 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:
    ParameterDeclaration, ParameterizedClass, ParameterizedTest
    • 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()