Package org.fest.assertions
Class ArrayInspection
java.lang.Object
org.fest.assertions.ArrayInspection
Understands utility methods for arrays.
- Since:
- 1.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Object[]
Copies the contents of the given array into an array of objects.private static <T extends Collection<Object>>
Tstatic int
Returns the size of the given array.Copies the contents of the given array into a list.Copies the contents of the given array into a list.private static void
validateIsArray
(Object array)
-
Constructor Details
-
ArrayInspection
private ArrayInspection()
-
-
Method Details
-
copy
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
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
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.
-
copy
-
sizeOf
Returns the size of the given array.- Parameters:
array
- the array.- Returns:
- the size of the given array.
- Throws:
NullPointerException
- if the given array isnull
.IllegalArgumentException
- if the given object is not an array.
-
validateIsArray
-