Class MapCompare

java.lang.Object
dev.javatools.maputils.MapCompare

public final class MapCompare
extends java.lang.Object
MapCompare utility will compare two maps and returns true if both maps are same. Otherwise it will return false. How does it compare both maps?
     Makes sure both the maps have the exact same keys and same values, it compares all values in the inner objects recursively.
     So, no matter how big is your map and what you have in your map, even the custom objects, it will make sure it compare all fields (field by field).
 
  • Method Summary

    Modifier and Type Method Description
    static boolean equal​(java.util.Map left, java.util.Map right)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • equal

      public static boolean equal​(java.util.Map left, java.util.Map right)
      Parameters:
      left - First map that needs to be compared with Second map
      right - Second map that needs to be compared with First map
      Returns:
      returns true if both the maps are equal, otherwise false.