@API(status=INTERNAL,
since="5.2")
public class DefaultArgumentsAccessor
extends Object
implements ArgumentsAccessor
ArgumentsAccessor API.
Delegates conversion to DefaultArgumentConverter.
ArgumentsAccessor,
DefaultArgumentConverter,
ParameterizedTest| Constructor and Description |
|---|
DefaultArgumentsAccessor(Object... arguments) |
| Modifier and Type | Method and Description |
|---|---|
Object |
get(int index)
Get the value of the argument at the given index as an
Object. |
<T> T |
get(int index,
Class<T> requiredType)
Get the value of the argument at the given index as an instance of the
required type.
|
Boolean |
getBoolean(int index)
Get the value of the argument at the given index as a
Boolean,
performing automatic type conversion as necessary. |
Byte |
getByte(int index)
Get the value of the argument at the given index as a
Byte,
performing automatic type conversion as necessary. |
Character |
getCharacter(int index)
Get the value of the argument at the given index as a
Character,
performing automatic type conversion as necessary. |
Double |
getDouble(int index)
Get the value of the argument at the given index as a
Double,
performing automatic type conversion as necessary. |
Float |
getFloat(int index)
Get the value of the argument at the given index as a
Float,
performing automatic type conversion as necessary. |
Integer |
getInteger(int index)
Get the value of the argument at the given index as a
Integer,
performing automatic type conversion as necessary. |
Long |
getLong(int index)
Get the value of the argument at the given index as a
Long,
performing automatic type conversion as necessary. |
Short |
getShort(int index)
Get the value of the argument at the given index as a
Short,
performing automatic type conversion as necessary. |
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.
|
Object[] |
toArray()
Get all arguments in this accessor as an array.
|
List<Object> |
toList()
Get all arguments in this accessor as an immutable list.
|
public DefaultArgumentsAccessor(Object... arguments)
public 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,
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 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 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 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 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 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 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 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 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 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 Object[] toArray()
ArgumentsAccessortoArray in interface ArgumentsAccessorpublic List<Object> toList()
ArgumentsAccessortoList in interface ArgumentsAccessorCopyright © 2020. All rights reserved.