package com.google.firebase.firestore.proto; import com.google.protobuf.InvalidProtocolBufferException; import o.AQX; import o.JsL; import o.KUw; import o.MTP; import o.QwV; import o.XgX; /* loaded from: classes2.dex */ public final class WriteBatch extends KUw implements WriteBatchOrBuilder { public static final int BASE_WRITES_FIELD_NUMBER = 4; public static final int BATCH_ID_FIELD_NUMBER = 1; private static final WriteBatch DEFAULT_INSTANCE; public static final int LOCAL_WRITE_TIME_FIELD_NUMBER = 3; private static volatile XgX PARSER = null; public static final int WRITES_FIELD_NUMBER = 2; private int batchId_; private AQX localWriteTime_; private MTP.RVV writes_ = emptyProtobufList(); private MTP.RVV baseWrites_ = emptyProtobufList(); private WriteBatch() { } public final int getWritesCount() { return this.writes_.size(); } public final JsL getWrites(int i) { return this.writes_.get(i); } private void ensureWritesIsMutable() { MTP.RVV rvv = this.writes_; if (rvv.e()) { return; } this.writes_ = KUw.mutableCopy(rvv); } /* JADX INFO: Access modifiers changed from: private */ public void addWrites(JsL jsL) { ensureWritesIsMutable(); this.writes_.add(jsL); } public final AQX getLocalWriteTime() { AQX aqx = this.localWriteTime_; return aqx == null ? AQX.c() : aqx; } /* JADX INFO: Access modifiers changed from: private */ public void setLocalWriteTime(AQX aqx) { this.localWriteTime_ = aqx; } public final int getBaseWritesCount() { return this.baseWrites_.size(); } public final JsL getBaseWrites(int i) { return this.baseWrites_.get(i); } private void ensureBaseWritesIsMutable() { MTP.RVV rvv = this.baseWrites_; if (rvv.e()) { return; } this.baseWrites_ = KUw.mutableCopy(rvv); } /* JADX INFO: Access modifiers changed from: private */ public void addBaseWrites(JsL jsL) { ensureBaseWritesIsMutable(); this.baseWrites_.add(jsL); } public static WriteBatch parseFrom(QwV qwV) throws InvalidProtocolBufferException { return (WriteBatch) KUw.parseFrom(DEFAULT_INSTANCE, qwV); } public static WriteBatch parseFrom(byte[] bArr) throws InvalidProtocolBufferException { return (WriteBatch) KUw.parseFrom(DEFAULT_INSTANCE, bArr); } public static Builder newBuilder() { return DEFAULT_INSTANCE.createBuilder(); } /* loaded from: classes2.dex */ public static final class Builder extends KUw.LWm implements WriteBatchOrBuilder { /* synthetic */ Builder(AnonymousClass1 anonymousClass1) { this(); } private Builder() { super(WriteBatch.DEFAULT_INSTANCE); } public final Builder setBatchId(int i) { copyOnWrite(); ((WriteBatch) this.instance).setBatchId(i); return this; } public final Builder addWrites(JsL jsL) { copyOnWrite(); ((WriteBatch) this.instance).addWrites(jsL); return this; } public final Builder setLocalWriteTime(AQX aqx) { copyOnWrite(); ((WriteBatch) this.instance).setLocalWriteTime(aqx); return this; } public final Builder addBaseWrites(JsL jsL) { copyOnWrite(); ((WriteBatch) this.instance).addBaseWrites(jsL); return this; } } /* renamed from: com.google.firebase.firestore.proto.WriteBatch$1, reason: invalid class name */ /* loaded from: classes2.dex */ static /* synthetic */ class AnonymousClass1 { static final int[] $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke; static { int[] iArr = new int[KUw.ojQ.values().length]; $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke = iArr; try { iArr[KUw.ojQ.NEW_MUTABLE_INSTANCE.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[KUw.ojQ.NEW_BUILDER.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[KUw.ojQ.BUILD_MESSAGE_INFO.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } try { $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[KUw.ojQ.GET_DEFAULT_INSTANCE.ordinal()] = 4; } catch (NoSuchFieldError unused4) { } try { $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[KUw.ojQ.GET_PARSER.ordinal()] = 5; } catch (NoSuchFieldError unused5) { } try { $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[KUw.ojQ.GET_MEMOIZED_IS_INITIALIZED.ordinal()] = 6; } catch (NoSuchFieldError unused6) { } try { $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[KUw.ojQ.SET_MEMOIZED_IS_INITIALIZED.ordinal()] = 7; } catch (NoSuchFieldError unused7) { } } } @Override // o.KUw public final Object dynamicMethod(KUw.ojQ ojq, Object obj, Object obj2) { XgX xgX; AnonymousClass1 anonymousClass1 = null; switch (AnonymousClass1.$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[ojq.ordinal()]) { case 1: return new WriteBatch(); case 2: return new Builder(anonymousClass1); case 3: return newMessageInfo(DEFAULT_INSTANCE, "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0002\u0000\u0001\u0004\u0002\u001b\u0003\t\u0004\u001b", new Object[]{"batchId_", "writes_", JsL.class, "localWriteTime_", "baseWrites_", JsL.class}); case 4: return DEFAULT_INSTANCE; case 5: XgX xgX2 = PARSER; if (xgX2 != null) { return xgX2; } synchronized (WriteBatch.class) { xgX = PARSER; if (xgX == null) { xgX = new KUw.HBt(DEFAULT_INSTANCE); PARSER = xgX; } } return xgX; case 6: return (byte) 1; case 7: return null; default: throw new UnsupportedOperationException(); } } static { WriteBatch writeBatch = new WriteBatch(); DEFAULT_INSTANCE = writeBatch; KUw.registerDefaultInstance(WriteBatch.class, writeBatch); } public final int getBatchId() { return this.batchId_; } /* JADX INFO: Access modifiers changed from: private */ public void setBatchId(int i) { this.batchId_ = i; } }