package g.e.b;

import java.io.IOException;
import java.io.StringWriter;

/* JADX INFO: loaded from: classes.dex */
public abstract class o {
    public boolean a() {
        throw new UnsupportedOperationException(getClass().getSimpleName());
    }

    public r b() {
        if (this instanceof r) {
            return (r) this;
        }
        throw new IllegalStateException("Not a JSON Object: " + this);
    }

    public u c() {
        if (this instanceof u) {
            return (u) this;
        }
        throw new IllegalStateException("Not a JSON Primitive: " + this);
    }

    public String d() {
        throw new UnsupportedOperationException(getClass().getSimpleName());
    }

    public String toString() {
        try {
            StringWriter stringWriter = new StringWriter();
            g.e.b.i0.c cVar = new g.e.b.i0.c(stringWriter);
            cVar.f4202t = true;
            g.e.b.g0.f0.q.V.b(cVar, this);
            return stringWriter.toString();
        } catch (IOException e2) {
            throw new AssertionError(e2);
        }
    }
}
