package com.bytedance.android.livesdk.feed.network;

import com.bytedance.covode.number.Covode;
import com.google.gson.c.a;
import com.google.gson.c.b;
import com.google.gson.c.c;
import com.google.gson.n;
import com.google.gson.u;

public class GsonProvider$BooleanTypeAdapter extends u<Boolean> {
    static {
        Covode.recordClassIndex(16146);
    }

    public GsonProvider$BooleanTypeAdapter() {
    }

    public /* synthetic */ GsonProvider$BooleanTypeAdapter(byte b) {
        this();
    }

    public /* synthetic */ Object read(a aVar) {
        b LJFF = aVar.LJFF();
        int i = GsonProvider$1.LIZ[LJFF.ordinal()];
        boolean z = true;
        if (i == 1) {
            return Boolean.valueOf(aVar.LJIIIZ());
        }
        if (i == 2) {
            aVar.LJIIJ();
            return null;
        } else if (i == 3) {
            if (aVar.LJIILIIL() == 0) {
                z = false;
            }
            return Boolean.valueOf(z);
        } else {
            throw new n("Expected BOOLEAN or NUMBER but was ".concat(String.valueOf(LJFF)));
        }
    }

    public /* synthetic */ void write(c cVar, Object obj) {
        Boolean bool = (Boolean) obj;
        if (bool == null) {
            cVar.LJFF();
        } else {
            cVar.LIZ(bool);
        }
    }
}
