Package org.kiwiproject.beta.base
Interface KiwiCasts2.CollectionCheckStrategy
- All Known Implementing Classes:
KiwiCasts2.DefaultCollectionCheckStrategy,KiwiCasts2.StandardCollectionCheckStrategy
- Enclosing class:
- KiwiCasts2
public static interface KiwiCasts2.CollectionCheckStrategy
Strategy interface for checking elements in a collection.
-
Method Summary
Modifier and TypeMethodDescription<T> Collection<T>checkElements(Class<T> expectedType, Collection<T> coll) Checks that elements in the collection are of the expected type.
-
Method Details
-
checkElements
<T> Collection<T> checkElements(Class<T> expectedType, Collection<T> coll) throws TypeMismatchException Checks that elements in the collection are of the expected type.- Type Parameters:
T- the expected element type- Parameters:
expectedType- the expected type of elements in the collectioncoll- the collection to check- Returns:
- the original collection if all elements match the expected type
- Throws:
TypeMismatchException- if an element is found with an incompatible type
-