mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-12-04 11:38:54 +01:00
48 lines
1.7 KiB
Java
48 lines
1.7 KiB
Java
package com.amazon.dee.app.elements;
|
|
|
|
import android.os.Bundle;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import rx.Single$$ExternalSyntheticBUOutline0;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes3.dex */
|
|
class ReactRouteAlias {
|
|
static final String PRIORITY = "priority";
|
|
static final String PROPS = "props";
|
|
static final String TEMPLATE = "template";
|
|
int priority;
|
|
HashMap<String, ReactRouteAliasProp> props;
|
|
String uri;
|
|
|
|
public ReactRouteAlias(Map map) {
|
|
if (!map.containsKey("template") || !map.containsKey("priority")) {
|
|
Single$$ExternalSyntheticBUOutline0.m$3("Malformed route alias");
|
|
throw null;
|
|
}
|
|
this.uri = ElementsUtils.getOrDefault(map, "template", "");
|
|
this.priority = ElementsUtils.getOrDefault(map, "priority", 50);
|
|
this.props = new HashMap<>();
|
|
if (map.containsKey(PROPS)) {
|
|
for (Map.Entry entry : ((Map) map.get(PROPS)).entrySet()) {
|
|
this.props.put((String) entry.getKey(), new ReactRouteAliasProp((String) entry.getValue()));
|
|
}
|
|
}
|
|
}
|
|
|
|
public Bundle transformProps(Bundle bundle) {
|
|
Bundle bundle2 = new Bundle();
|
|
bundle2.putAll(bundle);
|
|
for (Map.Entry<String, ReactRouteAliasProp> entry : this.props.entrySet()) {
|
|
String key = entry.getKey();
|
|
ReactRouteAliasProp value = entry.getValue();
|
|
int i = value.type;
|
|
if (i == 0) {
|
|
bundle2.putString(key, value.value);
|
|
} else if (i == 1) {
|
|
bundle2.putString(key, bundle.getString(value.value));
|
|
}
|
|
}
|
|
return bundle2;
|
|
}
|
|
}
|