Class KiwiCasts2.DefaultCollectionCheckStrategy

java.lang.Object
org.kiwiproject.beta.base.KiwiCasts2.DefaultCollectionCheckStrategy
All Implemented Interfaces:
KiwiCasts2.CollectionCheckStrategy
Enclosing class:
KiwiCasts2

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

    • DefaultCollectionCheckStrategy

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

    • checkElements

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