package k.a.q;

/* JADX INFO: compiled from: Json.kt */
/* JADX INFO: loaded from: classes.dex */
public final class d {
    private boolean a;
    private boolean b;
    private boolean c;
    private boolean d;
    private boolean e;
    private boolean f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private String f906g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    private boolean f907h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private boolean f908i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    private String f909j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    private boolean f910k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    private boolean f911l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    private k.a.r.c f912m;

    public d(a aVar) {
        j.p0.d.r.f(aVar, "json");
        this.a = aVar.d().e();
        this.b = aVar.d().f();
        this.c = aVar.d().g();
        this.d = aVar.d().l();
        this.e = aVar.d().b();
        this.f = aVar.d().h();
        this.f906g = aVar.d().i();
        this.f907h = aVar.d().d();
        this.f908i = aVar.d().k();
        this.f909j = aVar.d().c();
        this.f910k = aVar.d().a();
        this.f911l = aVar.d().j();
        this.f912m = aVar.e();
    }

    public final f a() {
        if (this.f908i && !j.p0.d.r.a(this.f909j, "type")) {
            throw new IllegalArgumentException("Class discriminator should not be specified when array polymorphism is specified".toString());
        }
        if (this.f) {
            if (!j.p0.d.r.a(this.f906g, "    ")) {
                String str = this.f906g;
                boolean z = false;
                int i2 = 0;
                while (true) {
                    boolean z2 = true;
                    if (i2 >= str.length()) {
                        z = true;
                        break;
                    }
                    char cCharAt = str.charAt(i2);
                    if (cCharAt != ' ' && cCharAt != '\t' && cCharAt != '\r' && cCharAt != '\n') {
                        z2 = false;
                    }
                    if (!z2) {
                        break;
                    }
                    i2++;
                }
                if (!z) {
                    throw new IllegalArgumentException(("Only whitespace, tab, newline and carriage return are allowed as pretty print symbols. Had " + this.f906g).toString());
                }
            }
        } else if (!j.p0.d.r.a(this.f906g, "    ")) {
            throw new IllegalArgumentException("Indent should not be specified when default printing mode is used".toString());
        }
        return new f(this.a, this.c, this.d, this.e, this.f, this.b, this.f906g, this.f907h, this.f908i, this.f909j, this.f910k, this.f911l);
    }

    public final k.a.r.c b() {
        return this.f912m;
    }

    public final void c(boolean z) {
        this.a = z;
    }

    public final void d(boolean z) {
        this.c = z;
    }
}
