Package dev.javatools.maputils
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 booleanequal(java.util.Map left, java.util.Map right)
-
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 mapright- Second map that needs to be compared with First map- Returns:
- returns true if both the maps are equal, otherwise false.
-