Class Utils
java.lang.Object
util.Utils
Utils provides utility methods for deep equality checks and other helper functions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
equalsContent
(Object a, Object b) Checks deep equality between two objects, supporting arrays, collections, maps, atomic types, and CharSequences.
-
Method Details
-
equalsContent
Checks deep equality between two objects, supporting arrays, collections, maps, atomic types, and CharSequences.- For arrays, performs a deep equality check. - For collections, checks size and recursively compares elements. - For maps, checks size and recursively compares values for each key. - For CharSequences, compares content. - For AtomicInteger/AtomicLong, compares values. - Falls back to
Objects.equals(Object, Object)
for other types.- Parameters:
a
- the first object to compareb
- the second object to compare- Returns:
true
if the objects are deeply equal,false
otherwise
-