MCPcopy
hub / github.com/ccxt/ccxt / safeBool2

Method safeBool2

java/lib/src/main/java/io/github/ccxt/Exchange.java:4076–4096  ·  view source on GitHub ↗
(Object dictionaryOrList, Object key1, Object key2, Object... optionalArgs)

Source from the content-addressed store, hash-verified

4074 }
4075
4076 public Object safeBool2(Object dictionaryOrList, Object key1, Object key2, Object... optionalArgs)
4077 {
4078 /**
4079 * @ignore
4080 * @method
4081 * @description safely extract boolean value from dictionary or list
4082 * @returns {bool | undefined}
4083 */
4084 Object defaultValue = Helpers.getArg(optionalArgs, 0, null);
4085 Object value = this.safeValue(dictionaryOrList, key1);
4086 if (Helpers.isTrue((value instanceof Boolean)))
4087 {
4088 return value;
4089 }
4090 Object value2 = this.safeValue(dictionaryOrList, key2);
4091 if (Helpers.isTrue((value2 instanceof Boolean)))
4092 {
4093 return value2;
4094 }
4095 return defaultValue;
4096 }
4097
4098 public Object safeBool(Object dictionaryOrList, Object key, Object... optionalArgs)
4099 {

Callers 15

afterConstructMethod · 0.95
handleParamBool2Method · 0.95
isPostOnlyMethod · 0.95
testSafeMethodsMethod · 0.95
parseTradeMethod · 0.45
parseOrderMethod · 0.45
createOrderRequestMethod · 0.45
editOrderMethod · 0.45
createOrderRequestMethod · 0.45

Calls 3

getArgMethod · 0.95
safeValueMethod · 0.95
isTrueMethod · 0.95

Tested by 1

testSafeMethodsMethod · 0.76