@API(status=INTERNAL,
since="5.2")
public class DefaultArgumentsAccessor
extends java.lang.Object
implements ArgumentsAccessor
ArgumentsAccessor API.
Delegates conversion to DefaultArgumentConverter.
ArgumentsAccessor,
DefaultArgumentConverter,
ParameterizedTest| Modifier and Type | Field and Description |
|---|---|
private java.lang.Object[] |
arguments |
| Constructor and Description |
|---|
DefaultArgumentsAccessor(java.lang.Object... arguments) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
get(int index)
Get the value of the argument at the given index as an
Object. |
<T> T |
get(int index,
java.lang.Class<T> requiredType)
Get the value of the argument at the given index as an instance of the
required type.
|
java.lang.Boolean |
getBoolean(int index)
Get the value of the argument at the given index as a
Boolean,
performing automatic type conversion as necessary. |
java.lang.Byte |
getByte(int index)
Get the value of the argument at the given index as a
Byte,
performing automatic type conversion as necessary. |
java.lang.Character |
getCharacter(int index)
Get the value of the argument at the given index as a
Character,
performing automatic type conversion as necessary. |
java.lang.Double |
getDouble(int index)
Get the value of the argument at the given index as a
Double,
performing automatic type conversion as necessary. |
java.lang.Float |
getFloat(int index)
Get the value of the argument at the given index as a
Float,
performing automatic type conversion as necessary. |
java.lang.Integer |
getInteger(int index)
Get the value of the argument at the given index as a
Integer,
performing automatic type conversion as necessary. |
java.lang.Long |
getLong(int index)
Get the value of the argument at the given index as a
Long,
performing automatic type conversion as necessary. |
java.lang.Short |
getShort(int index)
Get the value of the argument at the given index as a
Short,
performing automatic type conversion as necessary. |
java.lang.String |
getString(int index)
Get the value of the argument at the given index as a
String,
performing automatic type conversion as necessary. |
int |
size()
Get the number of arguments in this accessor.
|
java.lang.Object[] |
toArray()
Get all arguments in this accessor as an array.
|
java.util.List<java.lang.Object> |
toList()
Get all arguments in this accessor as an immutable list.
|
public DefaultArgumentsAccessor(java.lang.Object... arguments)
public java.lang.Object get(int index)
ArgumentsAccessorObject.get in interface ArgumentsAccessorindex - the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()nullpublic <T> T get(int index,
java.lang.Class<T> requiredType)
ArgumentsAccessorget in interface ArgumentsAccessorindex - the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()requiredType - the required type of the value; never nullnullpublic java.lang.Character getCharacter(int index)
ArgumentsAccessorCharacter,
performing automatic type conversion as necessary.getCharacter in interface ArgumentsAccessorindex - the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()nullpublic java.lang.Boolean getBoolean(int index)
ArgumentsAccessorBoolean,
performing automatic type conversion as necessary.getBoolean in interface ArgumentsAccessorindex - the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()nullpublic java.lang.Byte getByte(int index)
ArgumentsAccessorByte,
performing automatic type conversion as necessary.getByte in interface ArgumentsAccessorindex - the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()nullpublic java.lang.Short getShort(int index)
ArgumentsAccessorShort,
performing automatic type conversion as necessary.getShort in interface ArgumentsAccessorindex - the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()nullpublic java.lang.Integer getInteger(int index)
ArgumentsAccessorInteger,
performing automatic type conversion as necessary.getInteger in interface ArgumentsAccessorindex - the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()nullpublic java.lang.Long getLong(int index)
ArgumentsAccessorLong,
performing automatic type conversion as necessary.getLong in interface ArgumentsAccessorindex - the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()nullpublic java.lang.Float getFloat(int index)
ArgumentsAccessorFloat,
performing automatic type conversion as necessary.getFloat in interface ArgumentsAccessorindex - the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()nullpublic java.lang.Double getDouble(int index)
ArgumentsAccessorDouble,
performing automatic type conversion as necessary.getDouble in interface ArgumentsAccessorindex - the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()nullpublic java.lang.String getString(int index)
ArgumentsAccessorString,
performing automatic type conversion as necessary.getString in interface ArgumentsAccessorindex - the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()nullpublic int size()
ArgumentsAccessorsize in interface ArgumentsAccessorpublic java.lang.Object[] toArray()
ArgumentsAccessortoArray in interface ArgumentsAccessorpublic java.util.List<java.lang.Object> toList()
ArgumentsAccessortoList in interface ArgumentsAccessor