MCPcopy
hub / github.com/ccxt/ccxt / unique

Method unique

java/lib/src/main/java/io/github/ccxt/Exchange.java:1357–1375  ·  view source on GitHub ↗
(Object obj)

Source from the content-addressed store, hash-verified

1355 }
1356
1357 public static List<Object> unique(Object obj) {
1358 if (!(obj instanceof List<?> list)) {
1359 return null; // not a []string equivalent
1360 }
1361
1362 // ensure it's actually a List<String>
1363 for (Object e : list) {
1364 if (!(e instanceof String)) {
1365 return null;
1366 }
1367 }
1368
1369 // preserve order while deduplicating
1370 var seen = new LinkedHashSet<Object>();
1371 for (Object e : list) {
1372 seen.add((String) e);
1373 }
1374 return new ArrayList<Object>(seen);
1375 }
1376
1377 public int parseTimeframe(Object timeframe2) {
1378 if (timeframe2 == null) {

Callers 3

testUniqueFunction · 0.95
checkAddressMethod · 0.95
checkAddressMethod · 0.95

Calls 1

addMethod · 0.45

Tested by

no test coverage detected