Class KiwiCasts2.DefaultListCheckStrategy

java.lang.Object
org.kiwiproject.beta.base.KiwiCasts2.DefaultListCheckStrategy
All Implemented Interfaces:
KiwiCasts2.ListCheckStrategy
Enclosing class:
KiwiCasts2

public static class KiwiCasts2.DefaultListCheckStrategy extends Object implements KiwiCasts2.ListCheckStrategy
Default implementation of KiwiCasts2.ListCheckStrategy that uses KiwiCasts2.DEFAULT_MAX_NON_NULL_CHECKS as the maximum non-null checks and checks only one (non-null) element in the list.
  • Constructor Details

    • DefaultListCheckStrategy

      public DefaultListCheckStrategy()
      Constructs a new instance.
  • Method Details

    • checkElements

      public <T> List<T> checkElements(Class<T> expectedType, List<T> list)
      Checks that elements in the list are of the expected type.
      Specified by:
      checkElements in interface KiwiCasts2.ListCheckStrategy
      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