Class KiwiCollections2

java.lang.Object
org.kiwiproject.beta.collect.KiwiCollections2

@Beta public final class KiwiCollections2 extends Object
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 Details

    • findFirstOfType

      public static <T extends U, U> Optional<T> findFirstOfType(Class<T> theType, Collection<U> objects)
      Finds the first object having type T in a collection of objects of a base type U.
      Type Parameters:
      T - the type to find
      U - the type of objects in the collection
      Parameters:
      theType - the type to find
      objects - the collection to search
      Returns:
      the first object in collection of U objects having type T