Interface KiwiCasts2.CollectionCheckStrategy

All Known Implementing Classes:
KiwiCasts2.DefaultCollectionCheckStrategy, KiwiCasts2.StandardCollectionCheckStrategy
Enclosing class:
KiwiCasts2

public static interface KiwiCasts2.CollectionCheckStrategy
Strategy interface for checking elements in a collection.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> Collection<T>
    checkElements(Class<T> expectedType, Collection<T> coll)
    Checks that elements in the collection are of the expected type.
  • Method Details

    • checkElements

      <T> Collection<T> checkElements(Class<T> expectedType, Collection<T> coll) throws TypeMismatchException
      Checks that elements in the collection are of the expected type.
      Type Parameters:
      T - the expected element type
      Parameters:
      expectedType - the expected type of elements in the collection
      coll - the collection to check
      Returns:
      the original collection if all elements match the expected type
      Throws:
      TypeMismatchException - if an element is found with an incompatible type