Package org.kiwiproject.beta.base
Class KiwiCasts2.DefaultMapCheckStrategy
java.lang.Object
org.kiwiproject.beta.base.KiwiCasts2.DefaultMapCheckStrategy
- All Implemented Interfaces:
KiwiCasts2.MapCheckStrategy
- Enclosing class:
- KiwiCasts2
public static class KiwiCasts2.DefaultMapCheckStrategy
extends Object
implements KiwiCasts2.MapCheckStrategy
Default implementation of
KiwiCasts2.MapCheckStrategy that uses
KiwiCasts2.DEFAULT_MAX_NON_NULL_CHECKS as the maximum non-null checks
and checks only one (non-null) entry in the map.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<K,V> Map<K, V> checkEntries(Class<K> keyType, Class<V> valueType, Map<K, V> map) Checks that keys and values in the map are of the expected types.
-
Constructor Details
-
DefaultMapCheckStrategy
public DefaultMapCheckStrategy()Constructs a new instance with default settings.
-
-
Method Details
-
checkEntries
Checks that keys and values in the map are of the expected types.- Specified by:
checkEntriesin interfaceKiwiCasts2.MapCheckStrategy- Type Parameters:
K- the expected key typeV- the expected value type- Parameters:
keyType- the expected type of keys in the mapvalueType- the expected type of values in the mapmap- the map to check- Returns:
- the original map if all keys and values match the expected types
-