while (iterator.hasNextKey()) { String key = iterator.nextKey(); ReadableType readableType = params.getType(key); switch(readableType) {
static private OAuthRequest addParametersToRequest( OAuthRequest request, final String access_token, @Nullable final ReadableMap params ) { if (params != null && params.hasKey("params")) { ReadableMapKeySetIterator iterator = params.keySetIterator(); while (iterator.hasNextKey()) { String key = iterator.nextKey(); ReadableType readableType = params.getType(key); switch(readableType) { case String: String val = params.getString(key); // String escapedVal = Uri.encode(val); if (val.equals("access_token")) { val = access_token; } request.addParameter(key, val); break; default: throw new IllegalArgumentException("Could not read object with key: " + key); } } } return request; }
static HashMap<String, Object> toHashMap(ReadableMap map) { HashMap<String, Object> hashMap = new HashMap<>(); ReadableMapKeySetIterator iterator = map.keySetIterator(); while (iterator.hasNextKey()) { String key = iterator.nextKey(); switch (map.getType(key)) { case Null: hashMap.put(key, null); break; case Boolean: hashMap.put(key, map.getBoolean(key)); break; case Number: hashMap.put(key, map.getDouble(key)); break; case String: hashMap.put(key, map.getString(key)); break; case Map: hashMap.put(key,toHashMap(map.getMap(key))); break; case Array: hashMap.put(key, toArrayList(map.getArray(key))); break; default: throw new IllegalArgumentException("Could not convert object with key: " + key + "."); } } return hashMap; }
while (iterator.hasNextKey()) { String key = iterator.nextKey(); ReadableType type = readableMap.getType(key); switch (type) {
private MaterialDialog.Builder applyOptions(MaterialDialog.Builder builder, ReadableMap options) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException { ReadableMapKeySetIterator iterator = options.keySetIterator(); while(iterator.hasNextKey()) { String key = iterator.nextKey();