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(Object object) |
static String |
format(String[][] array)
Formats a two-dimensional
String array. |
public static boolean equal(@Nullable String[][] one, @Nullable String[][] two)
String
arrays are equal.one
- the first array.two
- the second array.true
if the arrays are equal, false
otherwise.@InternalApi public static String format(Object object)
@Nonnull public static String format(@Nullable 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.@Nonnull public static int[] copyOf(@Nonnull int[] array)
array
- the array to copy.NullPointerException
- if the array to copy is null
.public static <T> T[] copyOf(@Nonnull T[] array)
T
- the type of the values in this array.array
- the array to copy.NullPointerException
- if the array to copy is null
.Copyright © 2014–2019 AssertJ. All rights reserved.