Package org.pgpainless.util
Class CollectionUtils
java.lang.Object
org.pgpainless.util.CollectionUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> void
addAll
(Iterator<T> iterator, Collection<T> collection) Add all items from the iterator to the collection.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 Details
-
iteratorToList
- 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
-
addAll
Add all items from the iterator to the collection.- Type Parameters:
T
- type of item- Parameters:
iterator
- iterator to gather items fromcollection
- collection to add items to
-