public class CollectionUtils
extends java.lang.Object
| Constructor and Description |
|---|
CollectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
concat(java.lang.Iterable<? extends java.lang.Object> arr,
java.lang.String separator)
Builds a string from the
Iterable's elements and appends a separator. |
static <T> boolean |
contains(java.lang.Iterable<T> coll,
T item)
Checks whether the
Iterable contains the item. |
static <T> boolean |
contains(T[] coll,
T item)
Checks whether the array contains the item.
|
static <T> boolean |
equals(T a,
T b)
Checks whether the two items are either both null, or they're non-null and equal
|
static <T> java.util.List<T> |
fromArray(T[] arr)
Deprecated.
Use
Arrays.asList(Object...) |
static <T> java.util.List<T> |
toList(java.lang.Iterable<T> arr)
Constructs an
ArrayList from the Iterable. |
@Deprecated public static <T> java.util.List<T> fromArray(T[] arr)
Arrays.asList(Object...)ArrayList from the array.public static <T> java.util.List<T> toList(java.lang.Iterable<T> arr)
ArrayList from the Iterable.
Allows for wider usage than its array-only counterpart.public static java.lang.String concat(java.lang.Iterable<? extends java.lang.Object> arr,
java.lang.String separator)
Iterable's elements and appends a separator.
If no separator is to be added, use nullpublic static <T> boolean contains(java.lang.Iterable<T> coll,
T item)
Iterable contains the item. The item may be null.public static <T> boolean contains(T[] coll,
T item)
Iterables.public static <T> boolean equals(T a,
T b)