Package org.kiwiproject.beta.collect
Class KiwiCollections2
java.lang.Object
org.kiwiproject.beta.collect.KiwiCollections2
Utilities related to Collections.
These utilities could be considered for inclusion into kiwi's
KiwiCollections class. Or they
could stay here forever in limbo.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends U,U>
Optional<T>findFirstOfType(Class<T> theType, Collection<U> objects) Finds the first object having typeTin a collection of objects of a base typeU.
-
Method Details
-
findFirstOfType
Finds the first object having typeTin a collection of objects of a base typeU.- Type Parameters:
T- the type to findU- the type of objects in the collection- Parameters:
theType- the type to findobjects- the collection to search- Returns:
- the first object in the collection of U objects having type T
-