ArgumentsAccessor defines the public API for accessing arguments provided
by an ArgumentsProvider
for a single invocation of a
@ParameterizedTest method.
Specifically, an ArgumentsAccessor aggregates a set of
arguments for a given invocation of a parameterized test and provides convenience
methods for accessing those arguments in a type-safe manner with support for
automatic type conversion.
An instance of ArgumentsAccessor will be automatically supplied
for any parameter of type ArgumentsAccessor in a parameterized test.
In addition, ArgumentsAggregator implementations are given access to
an ArgumentsAccessor.
This interface is not intended to be implemented by clients.
Additional Kotlin arguments accessors can be
found as extension functions in the org.
package.
ArgumentsAggregator, org.junit.jupiter.params.ParameterizedTest
| Modifier and Type | Method and Description |
|---|---|
| public @Nullable Object | |
| public <T> @Nullable T | Returns: the value at the given index, potentiallynullthe index of the argument to get; must be greater than or
equal to zero and less than index, Class<T> sizethe required type of the value; never requiredType)nullGet the value of the argument at the given index as an instance of the required type. |
| public @Nullable Boolean | Returns: the value at the given index, potentiallynullthe index of the argument to get; must be greater than or
equal to zero and less than index)sizeGet the value of the argument at the given index as a |
| public @Nullable Byte | |
| public @Nullable Character | Returns: the value at the given index, potentiallynullthe index of the argument to get; must be greater than or
equal to zero and less than index)sizeGet the value of the argument at the given index as a |
| public @Nullable Double | |
| public @Nullable Float | |
| public @Nullable Integer | Returns: the value at the given index, potentiallynullthe index of the argument to get; must be greater than or
equal to zero and less than index)sizeGet the value of the argument at the given index as a |
| public int | |
| public @Nullable Long | |
| public @Nullable Short | |
| public @Nullable String | |
| public int | |
| public @Nullable Object[] | |
| public List |
| get | back to summary |
|---|---|
| public @Nullable Object get(int index) throws ArgumentAccessException Get the value of the argument at the given index as an | |
| get | back to summary |
|---|---|
| public <T> @Nullable T get(int index, Class<T> requiredType) throws ArgumentAccessException Get the value of the argument at the given index as an instance of the required type. | |
| getBoolean | back to summary |
|---|---|
| public @Nullable Boolean getBoolean(int index) throws ArgumentAccessException Get the value of the argument at the given index as a
| |
| getByte | back to summary |
|---|---|
| public @Nullable Byte getByte(int index) throws ArgumentAccessException Get the value of the argument at the given index as a
| |
| getCharacter | back to summary |
|---|---|
| public @Nullable Character getCharacter(int index) throws ArgumentAccessException Get the value of the argument at the given index as a
| |
| getDouble | back to summary |
|---|---|
| public @Nullable Double getDouble(int index) throws ArgumentAccessException Get the value of the argument at the given index as a
| |
| getFloat | back to summary |
|---|---|
| public @Nullable Float getFloat(int index) throws ArgumentAccessException Get the value of the argument at the given index as a
| |
| getInteger | back to summary |
|---|---|
| public @Nullable Integer getInteger(int index) throws ArgumentAccessException Get the value of the argument at the given index as a
| |
| getInvocationIndex | back to summary |
|---|---|
| public int getInvocationIndex() Get the index of the current test invocation. | |
| getLong | back to summary |
|---|---|
| public @Nullable Long getLong(int index) throws ArgumentAccessException Get the value of the argument at the given index as a
| |
| getShort | back to summary |
|---|---|
| public @Nullable Short getShort(int index) throws ArgumentAccessException Get the value of the argument at the given index as a
| |
| getString | back to summary |
|---|---|
| public @Nullable String getString(int index) throws ArgumentAccessException Get the value of the argument at the given index as a
| |
| size | back to summary |
|---|---|
| public int size() Get the number of arguments in this accessor. | |
| toArray | back to summary |
|---|---|
| public @Nullable Object[] toArray() Get all arguments in this accessor as an array. | |
| toList | back to summary |
|---|---|
| public List Get all arguments in this accessor as an immutable list. | |