Package org.kiwiproject.beta.base
Interface KiwiCasts2.MapCheckStrategy
- All Known Implementing Classes:
KiwiCasts2.DefaultMapCheckStrategy,KiwiCasts2.StandardMapCheckStrategy
- Enclosing class:
- KiwiCasts2
public static interface KiwiCasts2.MapCheckStrategy
Strategy interface for checking entries in a map.
-
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.
-
Method Details
-
checkEntries
<K,V> Map<K,V> checkEntries(Class<K> keyType, Class<V> valueType, Map<K, V> map) throws TypeMismatchExceptionChecks that keys and values in the map are of the expected types.- 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
- Throws:
TypeMismatchException- if a key or value is found with an incompatible type
-