package ed;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.Map;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes.dex */
public final class q {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final String f25842a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Object f25843b;

    public q(@NonNull String str, @Nullable Object obj) {
        this.f25842a = str;
        this.f25843b = obj;
    }

    @Nullable
    public <T> T argument(@NonNull String str) {
        Object obj = this.f25843b;
        if (obj == null) {
            return null;
        }
        if (obj instanceof Map) {
            return (T) ((Map) obj).get(str);
        }
        if (obj instanceof JSONObject) {
            return (T) ((JSONObject) obj).opt(str);
        }
        throw new ClassCastException();
    }

    @Nullable
    public <T> T arguments() {
        return (T) this.f25843b;
    }
}
