public final class Arrays extends Object
Modifier and Type | Method and Description |
---|---|
static int[] |
copyOf(int[] array)
Creates and returns a copy of the given array.
|
static <T> T[] |
copyOf(T[] array)
Creates and returns a copy of the given array.
|
static boolean |
equal(String[][] one,
String[][] two)
Verifies that the given
String arrays are equal. |
static String |
format(String[][] array)
Formats a two-dimensional
String array. |
static boolean |
isEmptyIntArray(int[] array)
Indicates whether the given array is
null or empty. |
public static boolean equal(String[][] one, String[][] two)
String
arrays are equal.one
- the first array.two
- the second array.true
if the arrays are equal, false
otherwise.public static String format(String[][] array)
String
array. For example, the array:
String[][] array = { { "0-0", "0-1", "0-2" }, { "1-0", "1-1", "1-2" }, { "2-0", "2-1", "2-2" }, { "3-0", "3-1", "3-2" }, };will be formatted as:
[['0-0', '0-1', '0-2'], ['1-0', '1-1', '1-2'], ['2-0', '2-1', '2-2'], ['3-0', '3-1', '3-2']]
array
- the array to format.public static int[] copyOf(int[] array)
array
- the array to copy.NullPointerException
- if the array to copy is null
.public static <T> T[] copyOf(T[] array)
T
- the generic type of the array.array
- the array to copy.NullPointerException
- if the array to copy is null
.public static boolean isEmptyIntArray(int[] array)
null
or empty.array
- the array to check.true
if the given array is null
or empty; false
otherwise.Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.