MCPcopy
hub / github.com/ccxt/ccxt / safeList

Method safeList

java/lib/src/main/java/io/github/ccxt/Exchange.java:4227–4246  ·  view source on GitHub ↗
(Object dictionaryOrList, Object key, Object... optionalArgs)

Source from the content-addressed store, hash-verified

4225 }
4226
4227 public Object safeList(Object dictionaryOrList, Object key, Object... optionalArgs)
4228 {
4229 /**
4230 * @ignore
4231 * @method
4232 * @description safely extract an Array from dictionary or list
4233 * @returns {Array | undefined}
4234 */
4235 Object defaultValue = Helpers.getArg(optionalArgs, 0, null);
4236 Object value = this.safeValue(dictionaryOrList, key, defaultValue);
4237 if (Helpers.isTrue(Helpers.isEqual(value, null)))
4238 {
4239 return defaultValue;
4240 }
4241 if (Helpers.isTrue(Helpers.isArray(value)))
4242 {
4243 return value;
4244 }
4245 return defaultValue;
4246 }
4247
4248 public void handleDeltas(Object orderbook, Object deltas)
4249 {

Callers 15

setMarketsMethod · 0.95
safeOrderMethod · 0.95
parsedFeeAndFeesMethod · 0.95
cleanCacheMethod · 0.95
testSafeMethodsMethod · 0.95
fetchCurrenciesMethod · 0.45
fetchMarketsMethod · 0.45
parseMarketMethod · 0.45
fetchBalanceMethod · 0.45

Calls 5

getArgMethod · 0.95
safeValueMethod · 0.95
isTrueMethod · 0.95
isEqualMethod · 0.95
isArrayMethod · 0.95

Tested by 4

testSafeMethodsMethod · 0.76
AssertStructureMethod · 0.36
fetchBestBidAskMethod · 0.36