package com.google.firebase.firestore.model.mutation; import com.google.firebase.database.collection.ImmutableSortedMap; import com.google.firebase.firestore.model.DocumentCollections; import com.google.firebase.firestore.model.DocumentKey; import com.google.firebase.firestore.model.SnapshotVersion; import com.google.firebase.firestore.util.Assert; import java.util.List; import o.QwV; /* loaded from: classes2.dex */ public final class MutationBatchResult { private final MutationBatch batch; private final SnapshotVersion commitVersion; private final ImmutableSortedMap docVersions; private final List mutationResults; private final QwV streamToken; private MutationBatchResult(MutationBatch mutationBatch, SnapshotVersion snapshotVersion, List list, QwV qwV, ImmutableSortedMap immutableSortedMap) { this.batch = mutationBatch; this.commitVersion = snapshotVersion; this.mutationResults = list; this.streamToken = qwV; this.docVersions = immutableSortedMap; } public static MutationBatchResult create(MutationBatch mutationBatch, SnapshotVersion snapshotVersion, List list, QwV qwV) { Assert.hardAssert(mutationBatch.getMutations().size() == list.size(), "Mutations sent %d must equal results received %d", Integer.valueOf(mutationBatch.getMutations().size()), Integer.valueOf(list.size())); ImmutableSortedMap emptyVersionMap = DocumentCollections.emptyVersionMap(); List mutations = mutationBatch.getMutations(); ImmutableSortedMap immutableSortedMap = emptyVersionMap; for (int i = 0; i < mutations.size(); i++) { immutableSortedMap = immutableSortedMap.insert(mutations.get(i).getKey(), list.get(i).getVersion()); } return new MutationBatchResult(mutationBatch, snapshotVersion, list, qwV, immutableSortedMap); } public final QwV getStreamToken() { return this.streamToken; } public final List getMutationResults() { return this.mutationResults; } public final ImmutableSortedMap getDocVersions() { return this.docVersions; } public final SnapshotVersion getCommitVersion() { return this.commitVersion; } public final MutationBatch getBatch() { return this.batch; } }