Class KiwiCasts2.DefaultSetCheckStrategy

java.lang.Object
org.kiwiproject.beta.base.KiwiCasts2.DefaultSetCheckStrategy
All Implemented Interfaces:
KiwiCasts2.SetCheckStrategy
Enclosing class:
KiwiCasts2

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

    • DefaultSetCheckStrategy

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

    • checkElements

      public <T> Set<T> checkElements(Class<T> expectedType, Set<T> set)
      Checks that elements in the set are of the expected type.
      Specified by:
      checkElements in interface KiwiCasts2.SetCheckStrategy
      Type Parameters:
      T - the expected element type
      Parameters:
      expectedType - the expected type of elements in the set
      set - the set to check
      Returns:
      the original set if all elements match the expected type