Top Description Fields Constructors Methods
org.assertj.core.util

public Class ArrayWrapperList

extends AbstractList<Object>
Class Inheritance
Static Imports
org.assertj.core.util.Preconditions.checkArgument

A list-like wrapper for arrays. This class does not provide type-safety in order to handle both arrays of objects and arrays of primitives.
Authors
Alex Ruiz, Yvonne Wang

Field Summary

Modifier and TypeField and Description
pack-priv final Object
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
checkIsInRange(int index)

public Object
get(int
index of the element to return
index
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.
public Class<?>

Returns:

the component type of the wrapped array.
getComponentType
()

Returns the component type of the wrapped array.

public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.
public static ArrayWrapperList

Returns:

the wrapped array or null if the given array was already null.
wrap
(Object
the array to wrap.
array
)

Wraps a given array with a ArrayWrapperList

Inherited from java.util.AbstractList:
addaddaddAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveremoveRangesetsubList

Field Detail

arrayback to summary
pack-priv final Object array
Annotations
@VisibleForTesting

Constructor Detail

ArrayWrapperListback to summary
pack-priv ArrayWrapperList(Object array)
Annotations
@VisibleForTesting

Method Detail

checkIsInRangeback to summary
private void checkIsInRange(int index)
getback to summary
public Object get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.AbstractList.get.

Returns the element at the specified position in this list.

Parameters
index:int

Doc from java.util.List.get.

index of the element to return

Returns:Object

Doc from java.util.List.get.

the element at the specified position in this list

Annotations
@Override
getComponentTypeback to summary
public Class<?> getComponentType()

Returns the component type of the wrapped array.

Returns:Class<?>

the component type of the wrapped array.

sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this list

Annotations
@Override
wrapback to summary
public static ArrayWrapperList wrap(Object array)

Wraps a given array with a ArrayWrapperList

Parameters
array:Object

the array to wrap.

Returns:ArrayWrapperList

the wrapped array or null if the given array was already null.

Exceptions
IllegalArgumentException:
if the array is not an array.