Class Utils

java.lang.Object
util.Utils

public class Utils extends Object
Utils provides utility methods for deep equality checks and other helper functions.
  • Method Details

    • equalsContent

      public static boolean equalsContent(Object a, Object b)
      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 compare
      b - the second object to compare
      Returns:
      true if the objects are deeply equal, false otherwise