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 Details

    • DefaultMapCheckStrategy

      public DefaultMapCheckStrategy()
      Constructs a new instance with default settings.
  • Method Details

    • checkEntries

      public <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.
      Specified by:
      checkEntries in interface KiwiCasts2.MapCheckStrategy
      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