Interface KiwiCasts2.ListCheckStrategy

All Known Implementing Classes:
KiwiCasts2.DefaultListCheckStrategy, KiwiCasts2.StandardListCheckStrategy
Enclosing class:
KiwiCasts2

public static interface KiwiCasts2.ListCheckStrategy
Strategy interface for checking elements in a list.
  • Method Summary

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

    • checkElements

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