Package org.kiwiproject.beta.base
Interface KiwiCasts2.ListCheckStrategy
- All Known Implementing Classes:
KiwiCasts2.DefaultListCheckStrategy,KiwiCasts2.StandardListCheckStrategy
- Enclosing class:
- KiwiCasts2
public static interface KiwiCasts2.ListCheckStrategy
Strategy interface for checking elements in a list.
-
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.
-
Method Details
-
checkElements
Checks that elements in the list are of the expected type.- 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
- Throws:
TypeMismatchException- if an element is found with an incompatible type
-