@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)
ArgumentsAccessor
Object
.get
in interface ArgumentsAccessor
index
- the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()
null
public <T> T get(int index, Class<T> requiredType)
ArgumentsAccessor
get
in interface ArgumentsAccessor
index
- 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 null
null
public Character getCharacter(int index)
ArgumentsAccessor
Character
,
performing automatic type conversion as necessary.getCharacter
in interface ArgumentsAccessor
index
- the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()
null
public Boolean getBoolean(int index)
ArgumentsAccessor
Boolean
,
performing automatic type conversion as necessary.getBoolean
in interface ArgumentsAccessor
index
- the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()
null
public Byte getByte(int index)
ArgumentsAccessor
Byte
,
performing automatic type conversion as necessary.getByte
in interface ArgumentsAccessor
index
- the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()
null
public Short getShort(int index)
ArgumentsAccessor
Short
,
performing automatic type conversion as necessary.getShort
in interface ArgumentsAccessor
index
- the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()
null
public Integer getInteger(int index)
ArgumentsAccessor
Integer
,
performing automatic type conversion as necessary.getInteger
in interface ArgumentsAccessor
index
- the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()
null
public Long getLong(int index)
ArgumentsAccessor
Long
,
performing automatic type conversion as necessary.getLong
in interface ArgumentsAccessor
index
- the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()
null
public Float getFloat(int index)
ArgumentsAccessor
Float
,
performing automatic type conversion as necessary.getFloat
in interface ArgumentsAccessor
index
- the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()
null
public Double getDouble(int index)
ArgumentsAccessor
Double
,
performing automatic type conversion as necessary.getDouble
in interface ArgumentsAccessor
index
- the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()
null
public String getString(int index)
ArgumentsAccessor
String
,
performing automatic type conversion as necessary.getString
in interface ArgumentsAccessor
index
- the index of the argument to get; must be greater than or
equal to zero and less than ArgumentsAccessor.size()
null
public int size()
ArgumentsAccessor
size
in interface ArgumentsAccessor
public Object[] toArray()
ArgumentsAccessor
toArray
in interface ArgumentsAccessor
public List<Object> toList()
ArgumentsAccessor
toList
in interface ArgumentsAccessor
Copyright © 2024. All rights reserved.