MCPcopy
hub / github.com/ccxt/ccxt / equals

Method equals

java/tests/src/main/java/tests/BaseTest.java:91–124  ·  view source on GitHub ↗
(Object a, Object b)

Source from the content-addressed store, hash-verified

89 }
90
91 public static boolean equals(Object a, Object b) {
92 if (a == b) return true;
93 // one null, one not
94 if (a == null || b == null) return false;
95
96 // List deep compare
97 if (a instanceof List<?> list1) {
98 if (!(b instanceof List<?> list2)) return false;
99 if (list1.size() != list2.size()) return false;
100
101 for (int i = 0; i < list1.size(); i++) {
102 Object item1 = list1.get(i);
103 Object item2 = list2.get(i);
104 if (!equals(item1, item2)) return false; // recursive
105 }
106 return true;
107 }
108
109 if (a instanceof Map<?, ?> map1) {
110 if (!(b instanceof Map<?, ?> map2)) return false;
111
112 for (Map.Entry<?, ?> e : map1.entrySet()) {
113 Object key = e.getKey();
114 if (!(key instanceof String)) {
115 return false;
116 }
117 if (!map2.containsKey(key)) return false;
118 if (!equals(e.getValue(), map2.get(key))) return false;
119 }
120 return true;
121 }
122
123 return isEqual(a, b);
124 }
125
126 public static Object mod(Object a, Object b) {
127 return Helpers.mod(a, b);

Callers 12

InitOptionsMethod · 0.45
getParamsFromArgsMethod · 0.45
setCredentialsMethod · 0.45
callDynamicMethod · 0.45
getCliArgValueMethod · 0.45
findCompatibleInMethod · 0.45
testSafeMethodsMethod · 0.45
testCryptographyMethod · 0.45
mainMethod · 0.45
mainMethod · 0.45

Calls 3

isEqualMethod · 0.95
getMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected