Java Map Equal mapEquals(Map leftMap, Map rightMap)

Here you can find the source of mapEquals(Map leftMap, Map rightMap)

Description

map Equals

License

Apache License

Declaration

public static <K, V> boolean mapEquals(Map<K, V> leftMap, Map<K, V> rightMap) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Map;

public class Main {
    public static <K, V> boolean mapEquals(Map<K, V> leftMap, Map<K, V> rightMap) {
        if (leftMap == null || rightMap == null || leftMap.size() != rightMap.size())
            return false;
        for (K key : leftMap.keySet()) {
            V value1 = leftMap.get(key);
            V value2 = rightMap.get(key);
            if (!value1.equals(value2))
                return false;
        }//w  w  w . j  av a 2  s. co  m
        return true;
    }
}

Related

  1. mapEquals(Map fst, Map snd)
  2. mapEquals(Map map1, Map map2)
  3. mapEquals(Map map1, Map map2)
  4. mapEquals(Map a, Object b)
  5. MapEquals(Map mapA, Map mapB)