org.fest.assertions.util
Class ArrayWrapperList
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<Object>
org.fest.assertions.util.ArrayWrapperList
- All Implemented Interfaces:
- Iterable<Object>, Collection<Object>, List<Object>
public class ArrayWrapperList
- extends AbstractList<Object>
An list-like wrapper for arrays. This class does not provide type-safety in order to handle both arrays
of objects and arrays of primitives.
- Author:
- Alex Ruiz, Yvonne Wang
Methods inherited from class java.util.AbstractList |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
wrap
public static ArrayWrapperList wrap(Object array)
- Wraps a given array with a
ArrayWrapperList
- Parameters:
array
- the array to wrap.
- Returns:
- the wrapped array or
null
if the given array was already null
.
- Throws:
IllegalArgumentException
- if the array
is not an array.
get
public Object get(int index)
-
- Specified by:
get
in interface List<Object>
- Specified by:
get
in class AbstractList<Object>
size
public int size()
-
- Specified by:
size
in interface Collection<Object>
- Specified by:
size
in interface List<Object>
- Specified by:
size
in class AbstractCollection<Object>
getComponentType
public Class<?> getComponentType()
- Returns the component type of the wrapped array.
- Returns:
- the component type of the wrapped array.
Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.