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