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 Type
    Method
    Description
    <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 TypeMismatchException
      Checks that keys and values in the map are of the expected types.
      Type Parameters:
      K - the expected key type
      V - the expected value type
      Parameters:
      keyType - the expected type of keys in the map
      valueType - the expected type of values in the map
      map - 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