Class CollectionsUtil
java.lang.Object
nl.pim16aap2.animatedarchitecture.core.util.CollectionsUtil
Utility class for collections.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T> Concatenates two lists into a single list.static <T> T[]concat(T[] first, T[] second) Concatenate two arrays into a single array.static <T> Optional<T> searchIterable(Iterable<T> iterable, Predicate<T> searchPredicate) Searches through anIterableobject using a provided search function.
-
Method Details
-
searchIterable
Searches through anIterableobject using a provided search function.- Type Parameters:
T- The type of objects stored in theIterable.- Parameters:
iterable- TheIterableobject to search through.searchPredicate- The search predicate to use.- Returns:
- The value in the
Iterableobject for which the search function returns true, otherwiseOptional.empty().
-
concat
public static <T> T[] concat(T[] first, T[] second) Concatenate two arrays into a single array.- Type Parameters:
T- The type of the arrays.- Parameters:
first- First array.second- Second array.- Returns:
- A single concatenated array.
-
concat
-