Package org.pgpainless.util
Class CollectionUtils
- java.lang.Object
-
- org.pgpainless.util.CollectionUtils
-
public final class CollectionUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T[]
concat(T t, T[] ts)
Return a new array which containsstatic <T> boolean
contains(T[] ts, T t)
Return true, if the given arraystatic <I> List<I>
iteratorToList(Iterator<I> iterator)
-
-
-
Method Detail
-
iteratorToList
public static <I> List<I> iteratorToList(Iterator<I> iterator)
- Type Parameters:
I
- type- Parameters:
iterator
- iterator- Returns:
- list
-
concat
public static <T> T[] concat(T t, T[] ts)
Return a new array which containst
as first element, followed by the elements ofts
.- Type Parameters:
T
- type- Parameters:
t
- headts
- tail- Returns:
- t and ts as array
-
contains
public static <T> boolean contains(T[] ts, T t)
Return true, if the given arrayts
contains the elementt
.- Type Parameters:
T
- type- Parameters:
ts
- elementst
- searched element- Returns:
- true if ts contains t, false otherwise
-
-