package com.google.firebase.encoders.proto;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.firebase.encoders.EncodingException;
import java.io.IOException;

/* JADX INFO: loaded from: classes2.dex */
public final class f implements ab.f {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public boolean f24080a = false;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public boolean f24081b = false;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public ab.b f24082c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final d f24083d;

    public f(d dVar) {
        this.f24083d = dVar;
    }

    @Override // ab.f
    @NonNull
    public ab.f add(@Nullable String str) throws IOException {
        if (this.f24080a) {
            throw new EncodingException("Cannot encode a second value in the ValueEncoderContext");
        }
        this.f24080a = true;
        this.f24083d.add(this.f24082c, str, this.f24081b);
        return this;
    }

    @Override // ab.f
    public final ab.f c(boolean z10) {
        if (this.f24080a) {
            throw new EncodingException("Cannot encode a second value in the ValueEncoderContext");
        }
        this.f24080a = true;
        this.f24083d.c(this.f24082c, z10 ? 1 : 0, this.f24081b);
        return this;
    }
}
