Package org.kiwiproject.beta.base
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Set<T>checkElements(Class<T> expectedType, Set<T> set) Checks that elements in the set are of the expected type.
-
Constructor Details
-
DefaultSetCheckStrategy
public DefaultSetCheckStrategy()Constructs a new instance.
-
-
Method Details
-
checkElements
Checks that elements in the set are of the expected type.- Specified by:
checkElementsin interfaceKiwiCasts2.SetCheckStrategy- Type Parameters:
T- the expected element type- Parameters:
expectedType- the expected type of elements in the setset- the set to check- Returns:
- the original set if all elements match the expected type
-