Package org.kiwiproject.beta.base
Class KiwiCasts2.DefaultCollectionCheckStrategy
java.lang.Object
org.kiwiproject.beta.base.KiwiCasts2.DefaultCollectionCheckStrategy
- All Implemented Interfaces:
KiwiCasts2.CollectionCheckStrategy
- Enclosing class:
- KiwiCasts2
public static class KiwiCasts2.DefaultCollectionCheckStrategy
extends Object
implements KiwiCasts2.CollectionCheckStrategy
Default implementation of
KiwiCasts2.CollectionCheckStrategy that uses
KiwiCasts2.DEFAULT_MAX_NON_NULL_CHECKS as the maximum non-null checks
and checks only one (non-null) element in the collection.-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
DefaultCollectionCheckStrategy
public DefaultCollectionCheckStrategy()Constructs a new instance.
-
-
Method Details
-
checkElements
Checks that elements in the collection are of the expected type.- Specified by:
checkElementsin interfaceKiwiCasts2.CollectionCheckStrategy- 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
-