org.fest.assertions
Class ArrayInspection

java.lang.Object
  extended by org.fest.assertions.ArrayInspection

public final class ArrayInspection
extends Object

Understands utility methods for arrays.

Since:
1.2
Author:
Alex Ruiz

Method Summary
static Object[] copy(Object array)
          Copies the contents of the given array into an array of objects.
static int sizeOf(Object array)
          Returns the size of the given array.
static List<Object> toList(Object array)
          Copies the contents of the given array into a list.
static Set<Object> toSet(Object array)
          Copies the contents of the given array into a list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

copy

public static Object[] copy(Object array)
Copies the contents of the given array into an array of objects.

Parameters:
array - the array to copy.
Returns:
an array of objects containing the contents of the array.
Throws:
IllegalArgumentException - if the given object is not an array.

toList

public static List<Object> toList(Object array)
Copies the contents of the given array into a list.

Parameters:
array - the array to copy.
Returns:
a list containing the contents of the array.
Throws:
IllegalArgumentException - if the given object is not an array.
Since:
1.3.

toSet

public static Set<Object> toSet(Object array)
Copies the contents of the given array into a list.

Parameters:
array - the array to copy.
Returns:
a list containing the contents of the array.
Throws:
IllegalArgumentException - if the given object is not an array.
Since:
1.3.

sizeOf

public static int sizeOf(Object array)
Returns the size of the given array.

Parameters:
array - the array.
Returns:
the size of the given array.
Throws:
NullPointerException - if the given array is null.
IllegalArgumentException - if the given object is not an array.


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.