diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Watch.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Watch.java index fb4e560660e3..9ca47be390de 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Watch.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Watch.java @@ -65,7 +65,7 @@ class Watch implements ApiStreamObserver { * Target ID used by watch. Watch uses a fixed target id since we only support one target per * stream. The actual target ID we use is arbitrary. */ - private static final int WATCH_TARGET_ID = 0xD0; + private static final int WATCH_TARGET_ID = 0x1; private static RetrySettings RETRY_SETTINGS = RetrySettings.newBuilder() diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ConformanceTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ConformanceTest.java index 740f2d8f1e11..1a5a1be41942 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ConformanceTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ConformanceTest.java @@ -22,9 +22,12 @@ import static com.google.cloud.firestore.UserDataConverter.NO_DELETES; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.when; import com.google.api.core.ApiFuture; +import com.google.api.core.SettableApiFuture; import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.firestore.Query.Direction; @@ -33,10 +36,13 @@ import com.google.cloud.firestore.conformance.TestDefinition.CreateTest; import com.google.cloud.firestore.conformance.TestDefinition.Cursor; import com.google.cloud.firestore.conformance.TestDefinition.DeleteTest; +import com.google.cloud.firestore.conformance.TestDefinition.DocChange; +import com.google.cloud.firestore.conformance.TestDefinition.DocChange.Kind; import com.google.cloud.firestore.conformance.TestDefinition.DocSnapshot; import com.google.cloud.firestore.conformance.TestDefinition.GetTest; import com.google.cloud.firestore.conformance.TestDefinition.OrderBy; import com.google.cloud.firestore.conformance.TestDefinition.SetTest; +import com.google.cloud.firestore.conformance.TestDefinition.Snapshot; import com.google.cloud.firestore.conformance.TestDefinition.UpdatePathsTest; import com.google.cloud.firestore.conformance.TestDefinition.UpdateTest; import com.google.cloud.firestore.conformance.TestDefinition.Where; @@ -44,22 +50,30 @@ import com.google.common.base.Preconditions; import com.google.firestore.v1beta1.BatchGetDocumentsRequest; import com.google.firestore.v1beta1.CommitRequest; +import com.google.firestore.v1beta1.Document; +import com.google.firestore.v1beta1.ListenRequest; +import com.google.firestore.v1beta1.ListenResponse; import com.google.firestore.v1beta1.Precondition; import com.google.firestore.v1beta1.RunQueryRequest; import com.google.firestore.v1beta1.Value; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; +import com.google.protobuf.GeneratedMessageV3; import com.google.protobuf.Message; import java.io.FileInputStream; import java.io.IOException; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Collections; +import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Nullable; import junit.framework.Protectable; import junit.framework.Test; import junit.framework.TestResult; @@ -72,9 +86,11 @@ import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Matchers; +import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.mockito.Spy; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; import org.threeten.bp.Instant; @RunWith(AllTests.class) @@ -90,22 +106,34 @@ private interface ConformanceTestCase extends Test, Describable {} /** If non-empty, only runs tests included in this set. */ private final Set includedTests = Collections.emptySet(); - @Spy - private FirestoreImpl firestoreMock = - new FirestoreImpl( - FirestoreOptions.newBuilder().setProjectId("projectID").build(), - Mockito.mock(FirestoreRpc.class)); - @Captor private ArgumentCaptor commitCapture; @Captor private ArgumentCaptor getAllCapture; - @Captor private ArgumentCaptor streamObserverCapture; + @Captor private ArgumentCaptor> streamObserverCapture; @Captor private ArgumentCaptor runQueryCapture; private Gson gson = new Gson(); + @Mock private ApiStreamObserver noOpRequestObserver; + + private FirestoreImpl firestoreMock; + + private Query watchQuery; + + public ConformanceTest() { + ScheduledExecutorService firestoreExecutor = Executors.newSingleThreadScheduledExecutor(); + FirestoreRpc firestoreRpc = Mockito.mock(FirestoreRpc.class); + when(firestoreRpc.getExecutor()).thenReturn(firestoreExecutor); + + firestoreMock = + Mockito.spy( + new FirestoreImpl( + FirestoreOptions.newBuilder().setProjectId("projectID").build(), firestoreRpc)); + watchQuery = collection("projects/projectID/databases/(default)/documents/C").orderBy("a"); + } + /** Generate the test suite based on the tests defined in test_data.binprotos. */ public static TestSuite suite() throws IOException { TestSuite suite = new TestSuite(); @@ -221,6 +249,84 @@ private Object convertValue(Object data) { } } + /** Converts a Kind into a DocumentChange.Type */ + private DocumentChange.Type convertKind(Kind kind) { + DocumentChange.Type changeType = null; + + switch (kind) { + case ADDED: + changeType = DocumentChange.Type.ADDED; + break; + case REMOVED: + changeType = DocumentChange.Type.REMOVED; + break; + case MODIFIED: + changeType = DocumentChange.Type.MODIFIED; + break; + default: + Assert.fail("Unable to convert document change for kind: " + kind); + break; + } + + return changeType; + } + + /** Converts a test snapshot to its API representation. */ + private QuerySnapshot convertQuerySnapshot(Snapshot testSnapshot) { + Instant readTime = + Instant.ofEpochSecond( + testSnapshot.getReadTime().getSeconds(), testSnapshot.getReadTime().getNanos()); + + final List documentSnapshots = new ArrayList<>(); + + for (Document document : testSnapshot.getDocsList()) { + documentSnapshots.add( + QueryDocumentSnapshot.fromDocument(firestoreMock, testSnapshot.getReadTime(), document)); + } + + DocumentSet documentSet = + DocumentSet.emptySet( + new Comparator() { + @Override + public int compare(QueryDocumentSnapshot o1, QueryDocumentSnapshot o2) { + // Comparator that preserves the insertion order as defined in the test case. + for (QueryDocumentSnapshot snapshot : documentSnapshots) { + if (o1.equals(o2)) { + return 0; + } else if (o1.equals(snapshot)) { + return -1; + } else if (o2.equals(snapshot)) { + return 1; + } + } + + Assert.fail("Unable to find position for document snapshot"); + return 0; + } + }); + + for (QueryDocumentSnapshot snapshot : documentSnapshots) { + documentSet = documentSet.add(snapshot); + } + + List documentChanges = new ArrayList<>(); + + for (DocChange documentChange : testSnapshot.getChangesList()) { + QueryDocumentSnapshot documentSnapshot = + QueryDocumentSnapshot.fromDocument( + firestoreMock, testSnapshot.getReadTime(), documentChange.getDoc()); + DocumentChange.Type changeType = convertKind(documentChange.getKind()); + documentChanges.add( + new DocumentChange( + documentSnapshot, + changeType, + documentChange.getOldIndex(), + documentChange.getNewIndex())); + } + + return QuerySnapshot.withChanges(watchQuery, readTime, documentSet, documentChanges); + } + /** Helper function to convert test values in a list to Firestore API types. */ private List convertArray(List list) { for (int i = 0; i < list.size(); ++i) { @@ -294,6 +400,9 @@ public void protect() throws Throwable { case QUERY: runQueryTest(testDefinition.getQuery()); break; + case LISTEN: + runWatchTest(testDefinition.getListen()); + break; default: throw new UnsupportedOperationException(); } @@ -330,6 +439,53 @@ private void runQueryTest(TestDefinition.QueryTest testCase) { } } + private void runWatchTest(TestDefinition.ListenTest testCase) + throws ExecutionException, InterruptedException { + final SettableApiFuture testCaseStarted = SettableApiFuture.create(); + final SettableApiFuture testCaseFinished = SettableApiFuture.create(); + + doAnswer( + new Answer>() { + @Override + public ApiStreamObserver answer(InvocationOnMock invocationOnMock) { + testCaseStarted.set(null); + return noOpRequestObserver; + } + }) + .when(firestoreMock) + .streamRequest(streamObserverCapture.capture(), Matchers.any(BidiStreamingCallable.class)); + + final List expectedSnapshots = new ArrayList<>(testCase.getSnapshotsList()); + + final ListenerRegistration registration = + watchQuery.addSnapshotListener( + new EventListener() { + @Override + public void onEvent( + @Nullable QuerySnapshot actualSnapshot, @Nullable FirestoreException error) { + try { + Assert.assertFalse(expectedSnapshots.isEmpty()); + Snapshot expectedSnapshot = expectedSnapshots.remove(0); + Assert.assertEquals(convertQuerySnapshot(expectedSnapshot), actualSnapshot); + if (expectedSnapshots.isEmpty()) { + testCaseFinished.set(null); + } + } catch (AssertionError e) { + testCaseFinished.setException(e); + } + } + }); + + testCaseStarted.get(); + + for (ListenResponse response : testCase.getResponsesList()) { + streamObserverCapture.getValue().onNext(response); + } + + testCaseFinished.get(); + registration.remove(); + } + /** Returns a new query with 'clause' applied. */ private Query applyClause(Query query, Clause clause) { FieldPath fieldPath; diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WatchTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WatchTest.java index ca469e528687..8080aa528656 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WatchTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WatchTest.java @@ -84,7 +84,7 @@ @RunWith(MockitoJUnitRunner.class) public class WatchTest { /** The Target ID used by the Java Firestore SDK. */ - private static final int TARGET_ID = 0xD0; + private static final int TARGET_ID = 0x1; /** The resume token used by this test harness. */ private static final ByteString RESUME_TOKEN = ByteString.copyFromUtf8("token"); @@ -654,7 +654,7 @@ public void queryWatchHandlesIgnoresDifferentTarget() throws InterruptedExceptio ListenResponse.Builder request = doc("coll/doc1", SINGLE_FIELD_PROTO).toBuilder(); request.getDocumentChangeBuilder().clearTargetIds(); - request.getDocumentChangeBuilder().addTargetIds(0x1); + request.getDocumentChangeBuilder().addTargetIds(0x2); send(request.build()); send(snapshot()); diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/conformance/TestDefinition.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/conformance/TestDefinition.java index c9e514647da6..6e0f9a857f4b 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/conformance/TestDefinition.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/conformance/TestDefinition.java @@ -908,6 +908,19 @@ public interface TestOrBuilder extends */ com.google.cloud.firestore.conformance.TestDefinition.QueryTestOrBuilder getQueryOrBuilder(); + /** + * .tests.ListenTest listen = 9; + */ + boolean hasListen(); + /** + * .tests.ListenTest listen = 9; + */ + com.google.cloud.firestore.conformance.TestDefinition.ListenTest getListen(); + /** + * .tests.ListenTest listen = 9; + */ + com.google.cloud.firestore.conformance.TestDefinition.ListenTestOrBuilder getListenOrBuilder(); + public com.google.cloud.firestore.conformance.TestDefinition.Test.TestCase getTestCase(); } /** @@ -1065,6 +1078,20 @@ private Test( testCase_ = 8; break; } + case 74: { + com.google.cloud.firestore.conformance.TestDefinition.ListenTest.Builder subBuilder = null; + if (testCase_ == 9) { + subBuilder = ((com.google.cloud.firestore.conformance.TestDefinition.ListenTest) test_).toBuilder(); + } + test_ = + input.readMessage(com.google.cloud.firestore.conformance.TestDefinition.ListenTest.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.firestore.conformance.TestDefinition.ListenTest) test_); + test_ = subBuilder.buildPartial(); + } + testCase_ = 9; + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -1100,6 +1127,7 @@ public enum TestCase UPDATE_PATHS(6), DELETE(7), QUERY(8), + LISTEN(9), TEST_NOT_SET(0); private final int value; private TestCase(int value) { @@ -1122,6 +1150,7 @@ public static TestCase forNumber(int value) { case 6: return UPDATE_PATHS; case 7: return DELETE; case 8: return QUERY; + case 9: return LISTEN; case 0: return TEST_NOT_SET; default: return null; } @@ -1361,6 +1390,32 @@ public com.google.cloud.firestore.conformance.TestDefinition.QueryTestOrBuilder return com.google.cloud.firestore.conformance.TestDefinition.QueryTest.getDefaultInstance(); } + public static final int LISTEN_FIELD_NUMBER = 9; + /** + * .tests.ListenTest listen = 9; + */ + public boolean hasListen() { + return testCase_ == 9; + } + /** + * .tests.ListenTest listen = 9; + */ + public com.google.cloud.firestore.conformance.TestDefinition.ListenTest getListen() { + if (testCase_ == 9) { + return (com.google.cloud.firestore.conformance.TestDefinition.ListenTest) test_; + } + return com.google.cloud.firestore.conformance.TestDefinition.ListenTest.getDefaultInstance(); + } + /** + * .tests.ListenTest listen = 9; + */ + public com.google.cloud.firestore.conformance.TestDefinition.ListenTestOrBuilder getListenOrBuilder() { + if (testCase_ == 9) { + return (com.google.cloud.firestore.conformance.TestDefinition.ListenTest) test_; + } + return com.google.cloud.firestore.conformance.TestDefinition.ListenTest.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; @@ -1397,6 +1452,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (testCase_ == 8) { output.writeMessage(8, (com.google.cloud.firestore.conformance.TestDefinition.QueryTest) test_); } + if (testCase_ == 9) { + output.writeMessage(9, (com.google.cloud.firestore.conformance.TestDefinition.ListenTest) test_); + } unknownFields.writeTo(output); } @@ -1436,6 +1494,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(8, (com.google.cloud.firestore.conformance.TestDefinition.QueryTest) test_); } + if (testCase_ == 9) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, (com.google.cloud.firestore.conformance.TestDefinition.ListenTest) test_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -1486,6 +1548,10 @@ public boolean equals(final java.lang.Object obj) { result = result && getQuery() .equals(other.getQuery()); break; + case 9: + result = result && getListen() + .equals(other.getListen()); + break; case 0: default: } @@ -1531,6 +1597,10 @@ public int hashCode() { hash = (37 * hash) + QUERY_FIELD_NUMBER; hash = (53 * hash) + getQuery().hashCode(); break; + case 9: + hash = (37 * hash) + LISTEN_FIELD_NUMBER; + hash = (53 * hash) + getListen().hashCode(); + break; case 0: default: } @@ -1743,6 +1813,13 @@ public com.google.cloud.firestore.conformance.TestDefinition.Test buildPartial() result.test_ = queryBuilder_.build(); } } + if (testCase_ == 9) { + if (listenBuilder_ == null) { + result.test_ = test_; + } else { + result.test_ = listenBuilder_.build(); + } + } result.testCase_ = testCase_; onBuilt(); return result; @@ -1818,6 +1895,10 @@ public Builder mergeFrom(com.google.cloud.firestore.conformance.TestDefinition.T mergeQuery(other.getQuery()); break; } + case LISTEN: { + mergeListen(other.getListen()); + break; + } case TEST_NOT_SET: { break; } @@ -2904,6 +2985,142 @@ public com.google.cloud.firestore.conformance.TestDefinition.QueryTestOrBuilder onChanged();; return queryBuilder_; } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.firestore.conformance.TestDefinition.ListenTest, com.google.cloud.firestore.conformance.TestDefinition.ListenTest.Builder, com.google.cloud.firestore.conformance.TestDefinition.ListenTestOrBuilder> listenBuilder_; + /** + * .tests.ListenTest listen = 9; + */ + public boolean hasListen() { + return testCase_ == 9; + } + /** + * .tests.ListenTest listen = 9; + */ + public com.google.cloud.firestore.conformance.TestDefinition.ListenTest getListen() { + if (listenBuilder_ == null) { + if (testCase_ == 9) { + return (com.google.cloud.firestore.conformance.TestDefinition.ListenTest) test_; + } + return com.google.cloud.firestore.conformance.TestDefinition.ListenTest.getDefaultInstance(); + } else { + if (testCase_ == 9) { + return listenBuilder_.getMessage(); + } + return com.google.cloud.firestore.conformance.TestDefinition.ListenTest.getDefaultInstance(); + } + } + /** + * .tests.ListenTest listen = 9; + */ + public Builder setListen(com.google.cloud.firestore.conformance.TestDefinition.ListenTest value) { + if (listenBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + test_ = value; + onChanged(); + } else { + listenBuilder_.setMessage(value); + } + testCase_ = 9; + return this; + } + /** + * .tests.ListenTest listen = 9; + */ + public Builder setListen( + com.google.cloud.firestore.conformance.TestDefinition.ListenTest.Builder builderForValue) { + if (listenBuilder_ == null) { + test_ = builderForValue.build(); + onChanged(); + } else { + listenBuilder_.setMessage(builderForValue.build()); + } + testCase_ = 9; + return this; + } + /** + * .tests.ListenTest listen = 9; + */ + public Builder mergeListen(com.google.cloud.firestore.conformance.TestDefinition.ListenTest value) { + if (listenBuilder_ == null) { + if (testCase_ == 9 && + test_ != com.google.cloud.firestore.conformance.TestDefinition.ListenTest.getDefaultInstance()) { + test_ = com.google.cloud.firestore.conformance.TestDefinition.ListenTest.newBuilder((com.google.cloud.firestore.conformance.TestDefinition.ListenTest) test_) + .mergeFrom(value).buildPartial(); + } else { + test_ = value; + } + onChanged(); + } else { + if (testCase_ == 9) { + listenBuilder_.mergeFrom(value); + } + listenBuilder_.setMessage(value); + } + testCase_ = 9; + return this; + } + /** + * .tests.ListenTest listen = 9; + */ + public Builder clearListen() { + if (listenBuilder_ == null) { + if (testCase_ == 9) { + testCase_ = 0; + test_ = null; + onChanged(); + } + } else { + if (testCase_ == 9) { + testCase_ = 0; + test_ = null; + } + listenBuilder_.clear(); + } + return this; + } + /** + * .tests.ListenTest listen = 9; + */ + public com.google.cloud.firestore.conformance.TestDefinition.ListenTest.Builder getListenBuilder() { + return getListenFieldBuilder().getBuilder(); + } + /** + * .tests.ListenTest listen = 9; + */ + public com.google.cloud.firestore.conformance.TestDefinition.ListenTestOrBuilder getListenOrBuilder() { + if ((testCase_ == 9) && (listenBuilder_ != null)) { + return listenBuilder_.getMessageOrBuilder(); + } else { + if (testCase_ == 9) { + return (com.google.cloud.firestore.conformance.TestDefinition.ListenTest) test_; + } + return com.google.cloud.firestore.conformance.TestDefinition.ListenTest.getDefaultInstance(); + } + } + /** + * .tests.ListenTest listen = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.firestore.conformance.TestDefinition.ListenTest, com.google.cloud.firestore.conformance.TestDefinition.ListenTest.Builder, com.google.cloud.firestore.conformance.TestDefinition.ListenTestOrBuilder> + getListenFieldBuilder() { + if (listenBuilder_ == null) { + if (!(testCase_ == 9)) { + test_ = com.google.cloud.firestore.conformance.TestDefinition.ListenTest.getDefaultInstance(); + } + listenBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.firestore.conformance.TestDefinition.ListenTest, com.google.cloud.firestore.conformance.TestDefinition.ListenTest.Builder, com.google.cloud.firestore.conformance.TestDefinition.ListenTestOrBuilder>( + (com.google.cloud.firestore.conformance.TestDefinition.ListenTest) test_, + getParentForChildren(), + isClean()); + test_ = null; + } + testCase_ = 9; + onChanged();; + return listenBuilder_; + } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFieldsProto3(unknownFields); @@ -19285,188 +19502,3673 @@ public com.google.cloud.firestore.conformance.TestDefinition.FieldPath getDefaul } - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_TestSuite_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_TestSuite_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_Test_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_Test_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_GetTest_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_GetTest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_CreateTest_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_CreateTest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_SetTest_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_SetTest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_UpdateTest_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_UpdateTest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_UpdatePathsTest_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_UpdatePathsTest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_DeleteTest_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_DeleteTest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_SetOption_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_SetOption_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_QueryTest_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_QueryTest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_Clause_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_Clause_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_Select_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_Select_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_Where_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_Where_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_OrderBy_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_OrderBy_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_Cursor_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_Cursor_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_DocSnapshot_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_DocSnapshot_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tests_FieldPath_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tests_FieldPath_fieldAccessorTable; + public interface ListenTestOrBuilder extends + // @@protoc_insertion_point(interface_extends:tests.ListenTest) + com.google.protobuf.MessageOrBuilder { - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + java.util.List + getResponsesList(); + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + com.google.firestore.v1beta1.ListenResponse getResponses(int index); + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + int getResponsesCount(); + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + java.util.List + getResponsesOrBuilderList(); + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + com.google.firestore.v1beta1.ListenResponseOrBuilder getResponsesOrBuilder( + int index); + + /** + * repeated .tests.Snapshot snapshots = 2; + */ + java.util.List + getSnapshotsList(); + /** + * repeated .tests.Snapshot snapshots = 2; + */ + com.google.cloud.firestore.conformance.TestDefinition.Snapshot getSnapshots(int index); + /** + * repeated .tests.Snapshot snapshots = 2; + */ + int getSnapshotsCount(); + /** + * repeated .tests.Snapshot snapshots = 2; + */ + java.util.List + getSnapshotsOrBuilderList(); + /** + * repeated .tests.Snapshot snapshots = 2; + */ + com.google.cloud.firestore.conformance.TestDefinition.SnapshotOrBuilder getSnapshotsOrBuilder( + int index); + + /** + * bool is_error = 3; + */ + boolean getIsError(); } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\025test_definition.proto\022\005tests\032(google/f" + - "irestore/v1beta1/firestore.proto\032%google" + - "/firestore/v1beta1/common.proto\032$google/" + - "firestore/v1beta1/query.proto\"\'\n\tTestSui" + - "te\022\032\n\005tests\030\001 \003(\0132\013.tests.Test\"\243\002\n\004Test\022" + - "\023\n\013description\030\001 \001(\t\022\035\n\003get\030\002 \001(\0132\016.test" + - "s.GetTestH\000\022#\n\006create\030\003 \001(\0132\021.tests.Crea" + - "teTestH\000\022\035\n\003set\030\004 \001(\0132\016.tests.SetTestH\000\022" + - "#\n\006update\030\005 \001(\0132\021.tests.UpdateTestH\000\022.\n\014" + - "update_paths\030\006 \001(\0132\026.tests.UpdatePathsTe" + - "stH\000\022#\n\006delete\030\007 \001(\0132\021.tests.DeleteTestH" + - "\000\022!\n\005query\030\010 \001(\0132\020.tests.QueryTestH\000B\006\n\004" + - "test\"^\n\007GetTest\022\024\n\014doc_ref_path\030\001 \001(\t\022=\n" + - "\007request\030\002 \001(\0132,.google.firestore.v1beta" + - "1.GetDocumentRequest\"\201\001\n\nCreateTest\022\024\n\014d" + - "oc_ref_path\030\001 \001(\t\022\021\n\tjson_data\030\002 \001(\t\0228\n\007" + - "request\030\003 \001(\0132\'.google.firestore.v1beta1" + - ".CommitRequest\022\020\n\010is_error\030\004 \001(\010\"\240\001\n\007Set" + - "Test\022\024\n\014doc_ref_path\030\001 \001(\t\022 \n\006option\030\002 \001" + - "(\0132\020.tests.SetOption\022\021\n\tjson_data\030\003 \001(\t\022" + - "8\n\007request\030\004 \001(\0132\'.google.firestore.v1be" + - "ta1.CommitRequest\022\020\n\010is_error\030\005 \001(\010\"\277\001\n\n" + - "UpdateTest\022\024\n\014doc_ref_path\030\001 \001(\t\022<\n\014prec" + - "ondition\030\002 \001(\0132&.google.firestore.v1beta" + - "1.Precondition\022\021\n\tjson_data\030\003 \001(\t\0228\n\007req" + - "uest\030\004 \001(\0132\'.google.firestore.v1beta1.Co" + - "mmitRequest\022\020\n\010is_error\030\005 \001(\010\"\355\001\n\017Update" + - "PathsTest\022\024\n\014doc_ref_path\030\001 \001(\t\022<\n\014preco" + - "ndition\030\002 \001(\0132&.google.firestore.v1beta1" + - ".Precondition\022%\n\013field_paths\030\003 \003(\0132\020.tes" + - "ts.FieldPath\022\023\n\013json_values\030\004 \003(\t\0228\n\007req" + - "uest\030\005 \001(\0132\'.google.firestore.v1beta1.Co" + - "mmitRequest\022\020\n\010is_error\030\006 \001(\010\"\254\001\n\nDelete" + - "Test\022\024\n\014doc_ref_path\030\001 \001(\t\022<\n\014preconditi" + - "on\030\002 \001(\0132&.google.firestore.v1beta1.Prec" + - "ondition\0228\n\007request\030\003 \001(\0132\'.google.fires" + - "tore.v1beta1.CommitRequest\022\020\n\010is_error\030\004" + - " \001(\010\":\n\tSetOption\022\013\n\003all\030\001 \001(\010\022 \n\006fields" + - "\030\002 \003(\0132\020.tests.FieldPath\"\212\001\n\tQueryTest\022\021" + - "\n\tcoll_path\030\001 \001(\t\022\036\n\007clauses\030\002 \003(\0132\r.tes" + - "ts.Clause\0228\n\005query\030\003 \001(\0132).google.firest" + - "ore.v1beta1.StructuredQuery\022\020\n\010is_error\030" + - "\004 \001(\010\"\250\002\n\006Clause\022\037\n\006select\030\001 \001(\0132\r.tests" + - ".SelectH\000\022\035\n\005where\030\002 \001(\0132\014.tests.WhereH\000" + - "\022\"\n\010order_by\030\003 \001(\0132\016.tests.OrderByH\000\022\020\n\006" + - "offset\030\004 \001(\005H\000\022\017\n\005limit\030\005 \001(\005H\000\022!\n\010start" + - "_at\030\006 \001(\0132\r.tests.CursorH\000\022$\n\013start_afte" + - "r\030\007 \001(\0132\r.tests.CursorH\000\022\037\n\006end_at\030\010 \001(\013" + - "2\r.tests.CursorH\000\022#\n\nend_before\030\t \001(\0132\r." + - "tests.CursorH\000B\010\n\006clause\"*\n\006Select\022 \n\006fi" + - "elds\030\001 \003(\0132\020.tests.FieldPath\"G\n\005Where\022\036\n" + - "\004path\030\001 \001(\0132\020.tests.FieldPath\022\n\n\002op\030\002 \001(" + - "\t\022\022\n\njson_value\030\003 \001(\t\"<\n\007OrderBy\022\036\n\004path" + - "\030\001 \001(\0132\020.tests.FieldPath\022\021\n\tdirection\030\002 " + - "\001(\t\"G\n\006Cursor\022(\n\014doc_snapshot\030\001 \001(\0132\022.te" + - "sts.DocSnapshot\022\023\n\013json_values\030\002 \003(\t\".\n\013" + - "DocSnapshot\022\014\n\004path\030\001 \001(\t\022\021\n\tjson_data\030\002" + - " \001(\t\"\032\n\tFieldPath\022\r\n\005field\030\001 \003(\tBM\n&com." + - "google.cloud.firestore.conformance\252\002\"Goo" + - "gle.Cloud.Firestore.Tests.Protob\006proto3" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.firestore.v1beta1.FirestoreProto.getDescriptor(), - com.google.firestore.v1beta1.CommonProto.getDescriptor(), - com.google.firestore.v1beta1.QueryProto.getDescriptor(), - }, assigner); - internal_static_tests_TestSuite_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tests_TestSuite_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tests_TestSuite_descriptor, + /** + *
+   * A test of the Listen streaming RPC (a.k.a. FireStore watch).
+   * If the sequence of responses is provided to the implementation,
+   * it should produce the sequence of snapshots.
+   * If is_error is true, an error should occur after the snapshots.
+   * The tests assume that the query is
+   * Collection("projects/projectID/databases/(default)/documents/C").OrderBy("a", Ascending)
+   * The watch target ID used in these tests is 1. Test interpreters
+   * should either change their client's ID for testing,
+   * or change the ID in the tests before running them.
+   * 
+ * + * Protobuf type {@code tests.ListenTest} + */ + public static final class ListenTest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:tests.ListenTest) + ListenTestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListenTest.newBuilder() to construct. + private ListenTest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListenTest() { + responses_ = java.util.Collections.emptyList(); + snapshots_ = java.util.Collections.emptyList(); + isError_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListenTest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + responses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + responses_.add( + input.readMessage(com.google.firestore.v1beta1.ListenResponse.parser(), extensionRegistry)); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + snapshots_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + snapshots_.add( + input.readMessage(com.google.cloud.firestore.conformance.TestDefinition.Snapshot.parser(), extensionRegistry)); + break; + } + case 24: { + + isError_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + snapshots_ = java.util.Collections.unmodifiableList(snapshots_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.firestore.conformance.TestDefinition.internal_static_tests_ListenTest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.firestore.conformance.TestDefinition.internal_static_tests_ListenTest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.firestore.conformance.TestDefinition.ListenTest.class, com.google.cloud.firestore.conformance.TestDefinition.ListenTest.Builder.class); + } + + private int bitField0_; + public static final int RESPONSES_FIELD_NUMBER = 1; + private java.util.List responses_; + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public java.util.List getResponsesList() { + return responses_; + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public int getResponsesCount() { + return responses_.size(); + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public com.google.firestore.v1beta1.ListenResponse getResponses(int index) { + return responses_.get(index); + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public com.google.firestore.v1beta1.ListenResponseOrBuilder getResponsesOrBuilder( + int index) { + return responses_.get(index); + } + + public static final int SNAPSHOTS_FIELD_NUMBER = 2; + private java.util.List snapshots_; + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public java.util.List getSnapshotsList() { + return snapshots_; + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public java.util.List + getSnapshotsOrBuilderList() { + return snapshots_; + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public int getSnapshotsCount() { + return snapshots_.size(); + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public com.google.cloud.firestore.conformance.TestDefinition.Snapshot getSnapshots(int index) { + return snapshots_.get(index); + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public com.google.cloud.firestore.conformance.TestDefinition.SnapshotOrBuilder getSnapshotsOrBuilder( + int index) { + return snapshots_.get(index); + } + + public static final int IS_ERROR_FIELD_NUMBER = 3; + private boolean isError_; + /** + * bool is_error = 3; + */ + public boolean getIsError() { + return isError_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(1, responses_.get(i)); + } + for (int i = 0; i < snapshots_.size(); i++) { + output.writeMessage(2, snapshots_.get(i)); + } + if (isError_ != false) { + output.writeBool(3, isError_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, responses_.get(i)); + } + for (int i = 0; i < snapshots_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, snapshots_.get(i)); + } + if (isError_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, isError_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.firestore.conformance.TestDefinition.ListenTest)) { + return super.equals(obj); + } + com.google.cloud.firestore.conformance.TestDefinition.ListenTest other = (com.google.cloud.firestore.conformance.TestDefinition.ListenTest) obj; + + boolean result = true; + result = result && getResponsesList() + .equals(other.getResponsesList()); + result = result && getSnapshotsList() + .equals(other.getSnapshotsList()); + result = result && (getIsError() + == other.getIsError()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().hashCode(); + } + if (getSnapshotsCount() > 0) { + hash = (37 * hash) + SNAPSHOTS_FIELD_NUMBER; + hash = (53 * hash) + getSnapshotsList().hashCode(); + } + hash = (37 * hash) + IS_ERROR_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsError()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.firestore.conformance.TestDefinition.ListenTest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.firestore.conformance.TestDefinition.ListenTest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.firestore.conformance.TestDefinition.ListenTest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.firestore.conformance.TestDefinition.ListenTest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.firestore.conformance.TestDefinition.ListenTest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.firestore.conformance.TestDefinition.ListenTest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.firestore.conformance.TestDefinition.ListenTest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.firestore.conformance.TestDefinition.ListenTest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.firestore.conformance.TestDefinition.ListenTest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.firestore.conformance.TestDefinition.ListenTest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.firestore.conformance.TestDefinition.ListenTest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.firestore.conformance.TestDefinition.ListenTest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.firestore.conformance.TestDefinition.ListenTest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * A test of the Listen streaming RPC (a.k.a. FireStore watch).
+     * If the sequence of responses is provided to the implementation,
+     * it should produce the sequence of snapshots.
+     * If is_error is true, an error should occur after the snapshots.
+     * The tests assume that the query is
+     * Collection("projects/projectID/databases/(default)/documents/C").OrderBy("a", Ascending)
+     * The watch target ID used in these tests is 1. Test interpreters
+     * should either change their client's ID for testing,
+     * or change the ID in the tests before running them.
+     * 
+ * + * Protobuf type {@code tests.ListenTest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:tests.ListenTest) + com.google.cloud.firestore.conformance.TestDefinition.ListenTestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.firestore.conformance.TestDefinition.internal_static_tests_ListenTest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.firestore.conformance.TestDefinition.internal_static_tests_ListenTest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.firestore.conformance.TestDefinition.ListenTest.class, com.google.cloud.firestore.conformance.TestDefinition.ListenTest.Builder.class); + } + + // Construct using com.google.cloud.firestore.conformance.TestDefinition.ListenTest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getResponsesFieldBuilder(); + getSnapshotsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + responsesBuilder_.clear(); + } + if (snapshotsBuilder_ == null) { + snapshots_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + snapshotsBuilder_.clear(); + } + isError_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.firestore.conformance.TestDefinition.internal_static_tests_ListenTest_descriptor; + } + + public com.google.cloud.firestore.conformance.TestDefinition.ListenTest getDefaultInstanceForType() { + return com.google.cloud.firestore.conformance.TestDefinition.ListenTest.getDefaultInstance(); + } + + public com.google.cloud.firestore.conformance.TestDefinition.ListenTest build() { + com.google.cloud.firestore.conformance.TestDefinition.ListenTest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.firestore.conformance.TestDefinition.ListenTest buildPartial() { + com.google.cloud.firestore.conformance.TestDefinition.ListenTest result = new com.google.cloud.firestore.conformance.TestDefinition.ListenTest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.build(); + } + if (snapshotsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + snapshots_ = java.util.Collections.unmodifiableList(snapshots_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.snapshots_ = snapshots_; + } else { + result.snapshots_ = snapshotsBuilder_.build(); + } + result.isError_ = isError_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.firestore.conformance.TestDefinition.ListenTest) { + return mergeFrom((com.google.cloud.firestore.conformance.TestDefinition.ListenTest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.firestore.conformance.TestDefinition.ListenTest other) { + if (other == com.google.cloud.firestore.conformance.TestDefinition.ListenTest.getDefaultInstance()) return this; + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + responsesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getResponsesFieldBuilder() : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + if (snapshotsBuilder_ == null) { + if (!other.snapshots_.isEmpty()) { + if (snapshots_.isEmpty()) { + snapshots_ = other.snapshots_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSnapshotsIsMutable(); + snapshots_.addAll(other.snapshots_); + } + onChanged(); + } + } else { + if (!other.snapshots_.isEmpty()) { + if (snapshotsBuilder_.isEmpty()) { + snapshotsBuilder_.dispose(); + snapshotsBuilder_ = null; + snapshots_ = other.snapshots_; + bitField0_ = (bitField0_ & ~0x00000002); + snapshotsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSnapshotsFieldBuilder() : null; + } else { + snapshotsBuilder_.addAllMessages(other.snapshots_); + } + } + } + if (other.getIsError() != false) { + setIsError(other.getIsError()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.firestore.conformance.TestDefinition.ListenTest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.firestore.conformance.TestDefinition.ListenTest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List responses_ = + java.util.Collections.emptyList(); + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + responses_ = new java.util.ArrayList(responses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1beta1.ListenResponse, com.google.firestore.v1beta1.ListenResponse.Builder, com.google.firestore.v1beta1.ListenResponseOrBuilder> responsesBuilder_; + + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public java.util.List getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public com.google.firestore.v1beta1.ListenResponse getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.firestore.v1beta1.ListenResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.firestore.v1beta1.ListenResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public Builder addResponses(com.google.firestore.v1beta1.ListenResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.firestore.v1beta1.ListenResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public Builder addResponses( + com.google.firestore.v1beta1.ListenResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.firestore.v1beta1.ListenResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public Builder addAllResponses( + java.lang.Iterable values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public com.google.firestore.v1beta1.ListenResponse.Builder getResponsesBuilder( + int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public com.google.firestore.v1beta1.ListenResponseOrBuilder getResponsesOrBuilder( + int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public java.util.List + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public com.google.firestore.v1beta1.ListenResponse.Builder addResponsesBuilder() { + return getResponsesFieldBuilder().addBuilder( + com.google.firestore.v1beta1.ListenResponse.getDefaultInstance()); + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public com.google.firestore.v1beta1.ListenResponse.Builder addResponsesBuilder( + int index) { + return getResponsesFieldBuilder().addBuilder( + index, com.google.firestore.v1beta1.ListenResponse.getDefaultInstance()); + } + /** + * repeated .google.firestore.v1beta1.ListenResponse responses = 1; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1beta1.ListenResponse, com.google.firestore.v1beta1.ListenResponse.Builder, com.google.firestore.v1beta1.ListenResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1beta1.ListenResponse, com.google.firestore.v1beta1.ListenResponse.Builder, com.google.firestore.v1beta1.ListenResponseOrBuilder>( + responses_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + private java.util.List snapshots_ = + java.util.Collections.emptyList(); + private void ensureSnapshotsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + snapshots_ = new java.util.ArrayList(snapshots_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.firestore.conformance.TestDefinition.Snapshot, com.google.cloud.firestore.conformance.TestDefinition.Snapshot.Builder, com.google.cloud.firestore.conformance.TestDefinition.SnapshotOrBuilder> snapshotsBuilder_; + + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public java.util.List getSnapshotsList() { + if (snapshotsBuilder_ == null) { + return java.util.Collections.unmodifiableList(snapshots_); + } else { + return snapshotsBuilder_.getMessageList(); + } + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public int getSnapshotsCount() { + if (snapshotsBuilder_ == null) { + return snapshots_.size(); + } else { + return snapshotsBuilder_.getCount(); + } + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public com.google.cloud.firestore.conformance.TestDefinition.Snapshot getSnapshots(int index) { + if (snapshotsBuilder_ == null) { + return snapshots_.get(index); + } else { + return snapshotsBuilder_.getMessage(index); + } + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public Builder setSnapshots( + int index, com.google.cloud.firestore.conformance.TestDefinition.Snapshot value) { + if (snapshotsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSnapshotsIsMutable(); + snapshots_.set(index, value); + onChanged(); + } else { + snapshotsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public Builder setSnapshots( + int index, com.google.cloud.firestore.conformance.TestDefinition.Snapshot.Builder builderForValue) { + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + snapshots_.set(index, builderForValue.build()); + onChanged(); + } else { + snapshotsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public Builder addSnapshots(com.google.cloud.firestore.conformance.TestDefinition.Snapshot value) { + if (snapshotsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSnapshotsIsMutable(); + snapshots_.add(value); + onChanged(); + } else { + snapshotsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public Builder addSnapshots( + int index, com.google.cloud.firestore.conformance.TestDefinition.Snapshot value) { + if (snapshotsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSnapshotsIsMutable(); + snapshots_.add(index, value); + onChanged(); + } else { + snapshotsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public Builder addSnapshots( + com.google.cloud.firestore.conformance.TestDefinition.Snapshot.Builder builderForValue) { + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + snapshots_.add(builderForValue.build()); + onChanged(); + } else { + snapshotsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public Builder addSnapshots( + int index, com.google.cloud.firestore.conformance.TestDefinition.Snapshot.Builder builderForValue) { + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + snapshots_.add(index, builderForValue.build()); + onChanged(); + } else { + snapshotsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public Builder addAllSnapshots( + java.lang.Iterable values) { + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, snapshots_); + onChanged(); + } else { + snapshotsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public Builder clearSnapshots() { + if (snapshotsBuilder_ == null) { + snapshots_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + snapshotsBuilder_.clear(); + } + return this; + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public Builder removeSnapshots(int index) { + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + snapshots_.remove(index); + onChanged(); + } else { + snapshotsBuilder_.remove(index); + } + return this; + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public com.google.cloud.firestore.conformance.TestDefinition.Snapshot.Builder getSnapshotsBuilder( + int index) { + return getSnapshotsFieldBuilder().getBuilder(index); + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public com.google.cloud.firestore.conformance.TestDefinition.SnapshotOrBuilder getSnapshotsOrBuilder( + int index) { + if (snapshotsBuilder_ == null) { + return snapshots_.get(index); } else { + return snapshotsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public java.util.List + getSnapshotsOrBuilderList() { + if (snapshotsBuilder_ != null) { + return snapshotsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(snapshots_); + } + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public com.google.cloud.firestore.conformance.TestDefinition.Snapshot.Builder addSnapshotsBuilder() { + return getSnapshotsFieldBuilder().addBuilder( + com.google.cloud.firestore.conformance.TestDefinition.Snapshot.getDefaultInstance()); + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public com.google.cloud.firestore.conformance.TestDefinition.Snapshot.Builder addSnapshotsBuilder( + int index) { + return getSnapshotsFieldBuilder().addBuilder( + index, com.google.cloud.firestore.conformance.TestDefinition.Snapshot.getDefaultInstance()); + } + /** + * repeated .tests.Snapshot snapshots = 2; + */ + public java.util.List + getSnapshotsBuilderList() { + return getSnapshotsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.firestore.conformance.TestDefinition.Snapshot, com.google.cloud.firestore.conformance.TestDefinition.Snapshot.Builder, com.google.cloud.firestore.conformance.TestDefinition.SnapshotOrBuilder> + getSnapshotsFieldBuilder() { + if (snapshotsBuilder_ == null) { + snapshotsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.firestore.conformance.TestDefinition.Snapshot, com.google.cloud.firestore.conformance.TestDefinition.Snapshot.Builder, com.google.cloud.firestore.conformance.TestDefinition.SnapshotOrBuilder>( + snapshots_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + snapshots_ = null; + } + return snapshotsBuilder_; + } + + private boolean isError_ ; + /** + * bool is_error = 3; + */ + public boolean getIsError() { + return isError_; + } + /** + * bool is_error = 3; + */ + public Builder setIsError(boolean value) { + + isError_ = value; + onChanged(); + return this; + } + /** + * bool is_error = 3; + */ + public Builder clearIsError() { + + isError_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:tests.ListenTest) + } + + // @@protoc_insertion_point(class_scope:tests.ListenTest) + private static final com.google.cloud.firestore.conformance.TestDefinition.ListenTest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.firestore.conformance.TestDefinition.ListenTest(); + } + + public static com.google.cloud.firestore.conformance.TestDefinition.ListenTest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListenTest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListenTest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.firestore.conformance.TestDefinition.ListenTest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SnapshotOrBuilder extends + // @@protoc_insertion_point(interface_extends:tests.Snapshot) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + java.util.List + getDocsList(); + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + com.google.firestore.v1beta1.Document getDocs(int index); + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + int getDocsCount(); + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + java.util.List + getDocsOrBuilderList(); + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + com.google.firestore.v1beta1.DocumentOrBuilder getDocsOrBuilder( + int index); + + /** + * repeated .tests.DocChange changes = 2; + */ + java.util.List + getChangesList(); + /** + * repeated .tests.DocChange changes = 2; + */ + com.google.cloud.firestore.conformance.TestDefinition.DocChange getChanges(int index); + /** + * repeated .tests.DocChange changes = 2; + */ + int getChangesCount(); + /** + * repeated .tests.DocChange changes = 2; + */ + java.util.List + getChangesOrBuilderList(); + /** + * repeated .tests.DocChange changes = 2; + */ + com.google.cloud.firestore.conformance.TestDefinition.DocChangeOrBuilder getChangesOrBuilder( + int index); + + /** + * .google.protobuf.Timestamp read_time = 3; + */ + boolean hasReadTime(); + /** + * .google.protobuf.Timestamp read_time = 3; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * .google.protobuf.Timestamp read_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + } + /** + * Protobuf type {@code tests.Snapshot} + */ + public static final class Snapshot extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:tests.Snapshot) + SnapshotOrBuilder { + private static final long serialVersionUID = 0L; + // Use Snapshot.newBuilder() to construct. + private Snapshot(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Snapshot() { + docs_ = java.util.Collections.emptyList(); + changes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Snapshot( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + docs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + docs_.add( + input.readMessage(com.google.firestore.v1beta1.Document.parser(), extensionRegistry)); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + changes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + changes_.add( + input.readMessage(com.google.cloud.firestore.conformance.TestDefinition.DocChange.parser(), extensionRegistry)); + break; + } + case 26: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + docs_ = java.util.Collections.unmodifiableList(docs_); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + changes_ = java.util.Collections.unmodifiableList(changes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.firestore.conformance.TestDefinition.internal_static_tests_Snapshot_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.firestore.conformance.TestDefinition.internal_static_tests_Snapshot_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.firestore.conformance.TestDefinition.Snapshot.class, com.google.cloud.firestore.conformance.TestDefinition.Snapshot.Builder.class); + } + + private int bitField0_; + public static final int DOCS_FIELD_NUMBER = 1; + private java.util.List docs_; + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public java.util.List getDocsList() { + return docs_; + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public java.util.List + getDocsOrBuilderList() { + return docs_; + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public int getDocsCount() { + return docs_.size(); + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public com.google.firestore.v1beta1.Document getDocs(int index) { + return docs_.get(index); + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public com.google.firestore.v1beta1.DocumentOrBuilder getDocsOrBuilder( + int index) { + return docs_.get(index); + } + + public static final int CHANGES_FIELD_NUMBER = 2; + private java.util.List changes_; + /** + * repeated .tests.DocChange changes = 2; + */ + public java.util.List getChangesList() { + return changes_; + } + /** + * repeated .tests.DocChange changes = 2; + */ + public java.util.List + getChangesOrBuilderList() { + return changes_; + } + /** + * repeated .tests.DocChange changes = 2; + */ + public int getChangesCount() { + return changes_.size(); + } + /** + * repeated .tests.DocChange changes = 2; + */ + public com.google.cloud.firestore.conformance.TestDefinition.DocChange getChanges(int index) { + return changes_.get(index); + } + /** + * repeated .tests.DocChange changes = 2; + */ + public com.google.cloud.firestore.conformance.TestDefinition.DocChangeOrBuilder getChangesOrBuilder( + int index) { + return changes_.get(index); + } + + public static final int READ_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp readTime_; + /** + * .google.protobuf.Timestamp read_time = 3; + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * .google.protobuf.Timestamp read_time = 3; + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * .google.protobuf.Timestamp read_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < docs_.size(); i++) { + output.writeMessage(1, docs_.get(i)); + } + for (int i = 0; i < changes_.size(); i++) { + output.writeMessage(2, changes_.get(i)); + } + if (readTime_ != null) { + output.writeMessage(3, getReadTime()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < docs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, docs_.get(i)); + } + for (int i = 0; i < changes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, changes_.get(i)); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getReadTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.firestore.conformance.TestDefinition.Snapshot)) { + return super.equals(obj); + } + com.google.cloud.firestore.conformance.TestDefinition.Snapshot other = (com.google.cloud.firestore.conformance.TestDefinition.Snapshot) obj; + + boolean result = true; + result = result && getDocsList() + .equals(other.getDocsList()); + result = result && getChangesList() + .equals(other.getChangesList()); + result = result && (hasReadTime() == other.hasReadTime()); + if (hasReadTime()) { + result = result && getReadTime() + .equals(other.getReadTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDocsCount() > 0) { + hash = (37 * hash) + DOCS_FIELD_NUMBER; + hash = (53 * hash) + getDocsList().hashCode(); + } + if (getChangesCount() > 0) { + hash = (37 * hash) + CHANGES_FIELD_NUMBER; + hash = (53 * hash) + getChangesList().hashCode(); + } + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.firestore.conformance.TestDefinition.Snapshot parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.firestore.conformance.TestDefinition.Snapshot parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.firestore.conformance.TestDefinition.Snapshot parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.firestore.conformance.TestDefinition.Snapshot parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.firestore.conformance.TestDefinition.Snapshot parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.firestore.conformance.TestDefinition.Snapshot parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.firestore.conformance.TestDefinition.Snapshot parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.firestore.conformance.TestDefinition.Snapshot parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.firestore.conformance.TestDefinition.Snapshot parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.firestore.conformance.TestDefinition.Snapshot parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.firestore.conformance.TestDefinition.Snapshot parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.firestore.conformance.TestDefinition.Snapshot parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.firestore.conformance.TestDefinition.Snapshot prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tests.Snapshot} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:tests.Snapshot) + com.google.cloud.firestore.conformance.TestDefinition.SnapshotOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.firestore.conformance.TestDefinition.internal_static_tests_Snapshot_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.firestore.conformance.TestDefinition.internal_static_tests_Snapshot_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.firestore.conformance.TestDefinition.Snapshot.class, com.google.cloud.firestore.conformance.TestDefinition.Snapshot.Builder.class); + } + + // Construct using com.google.cloud.firestore.conformance.TestDefinition.Snapshot.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getDocsFieldBuilder(); + getChangesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (docsBuilder_ == null) { + docs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + docsBuilder_.clear(); + } + if (changesBuilder_ == null) { + changes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + changesBuilder_.clear(); + } + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.firestore.conformance.TestDefinition.internal_static_tests_Snapshot_descriptor; + } + + public com.google.cloud.firestore.conformance.TestDefinition.Snapshot getDefaultInstanceForType() { + return com.google.cloud.firestore.conformance.TestDefinition.Snapshot.getDefaultInstance(); + } + + public com.google.cloud.firestore.conformance.TestDefinition.Snapshot build() { + com.google.cloud.firestore.conformance.TestDefinition.Snapshot result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.firestore.conformance.TestDefinition.Snapshot buildPartial() { + com.google.cloud.firestore.conformance.TestDefinition.Snapshot result = new com.google.cloud.firestore.conformance.TestDefinition.Snapshot(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (docsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + docs_ = java.util.Collections.unmodifiableList(docs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.docs_ = docs_; + } else { + result.docs_ = docsBuilder_.build(); + } + if (changesBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + changes_ = java.util.Collections.unmodifiableList(changes_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.changes_ = changes_; + } else { + result.changes_ = changesBuilder_.build(); + } + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.firestore.conformance.TestDefinition.Snapshot) { + return mergeFrom((com.google.cloud.firestore.conformance.TestDefinition.Snapshot)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.firestore.conformance.TestDefinition.Snapshot other) { + if (other == com.google.cloud.firestore.conformance.TestDefinition.Snapshot.getDefaultInstance()) return this; + if (docsBuilder_ == null) { + if (!other.docs_.isEmpty()) { + if (docs_.isEmpty()) { + docs_ = other.docs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDocsIsMutable(); + docs_.addAll(other.docs_); + } + onChanged(); + } + } else { + if (!other.docs_.isEmpty()) { + if (docsBuilder_.isEmpty()) { + docsBuilder_.dispose(); + docsBuilder_ = null; + docs_ = other.docs_; + bitField0_ = (bitField0_ & ~0x00000001); + docsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDocsFieldBuilder() : null; + } else { + docsBuilder_.addAllMessages(other.docs_); + } + } + } + if (changesBuilder_ == null) { + if (!other.changes_.isEmpty()) { + if (changes_.isEmpty()) { + changes_ = other.changes_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureChangesIsMutable(); + changes_.addAll(other.changes_); + } + onChanged(); + } + } else { + if (!other.changes_.isEmpty()) { + if (changesBuilder_.isEmpty()) { + changesBuilder_.dispose(); + changesBuilder_ = null; + changes_ = other.changes_; + bitField0_ = (bitField0_ & ~0x00000002); + changesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getChangesFieldBuilder() : null; + } else { + changesBuilder_.addAllMessages(other.changes_); + } + } + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.firestore.conformance.TestDefinition.Snapshot parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.firestore.conformance.TestDefinition.Snapshot) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List docs_ = + java.util.Collections.emptyList(); + private void ensureDocsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + docs_ = new java.util.ArrayList(docs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1beta1.Document, com.google.firestore.v1beta1.Document.Builder, com.google.firestore.v1beta1.DocumentOrBuilder> docsBuilder_; + + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public java.util.List getDocsList() { + if (docsBuilder_ == null) { + return java.util.Collections.unmodifiableList(docs_); + } else { + return docsBuilder_.getMessageList(); + } + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public int getDocsCount() { + if (docsBuilder_ == null) { + return docs_.size(); + } else { + return docsBuilder_.getCount(); + } + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public com.google.firestore.v1beta1.Document getDocs(int index) { + if (docsBuilder_ == null) { + return docs_.get(index); + } else { + return docsBuilder_.getMessage(index); + } + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public Builder setDocs( + int index, com.google.firestore.v1beta1.Document value) { + if (docsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocsIsMutable(); + docs_.set(index, value); + onChanged(); + } else { + docsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public Builder setDocs( + int index, com.google.firestore.v1beta1.Document.Builder builderForValue) { + if (docsBuilder_ == null) { + ensureDocsIsMutable(); + docs_.set(index, builderForValue.build()); + onChanged(); + } else { + docsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public Builder addDocs(com.google.firestore.v1beta1.Document value) { + if (docsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocsIsMutable(); + docs_.add(value); + onChanged(); + } else { + docsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public Builder addDocs( + int index, com.google.firestore.v1beta1.Document value) { + if (docsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocsIsMutable(); + docs_.add(index, value); + onChanged(); + } else { + docsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public Builder addDocs( + com.google.firestore.v1beta1.Document.Builder builderForValue) { + if (docsBuilder_ == null) { + ensureDocsIsMutable(); + docs_.add(builderForValue.build()); + onChanged(); + } else { + docsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public Builder addDocs( + int index, com.google.firestore.v1beta1.Document.Builder builderForValue) { + if (docsBuilder_ == null) { + ensureDocsIsMutable(); + docs_.add(index, builderForValue.build()); + onChanged(); + } else { + docsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public Builder addAllDocs( + java.lang.Iterable values) { + if (docsBuilder_ == null) { + ensureDocsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, docs_); + onChanged(); + } else { + docsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public Builder clearDocs() { + if (docsBuilder_ == null) { + docs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + docsBuilder_.clear(); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public Builder removeDocs(int index) { + if (docsBuilder_ == null) { + ensureDocsIsMutable(); + docs_.remove(index); + onChanged(); + } else { + docsBuilder_.remove(index); + } + return this; + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public com.google.firestore.v1beta1.Document.Builder getDocsBuilder( + int index) { + return getDocsFieldBuilder().getBuilder(index); + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public com.google.firestore.v1beta1.DocumentOrBuilder getDocsOrBuilder( + int index) { + if (docsBuilder_ == null) { + return docs_.get(index); } else { + return docsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public java.util.List + getDocsOrBuilderList() { + if (docsBuilder_ != null) { + return docsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(docs_); + } + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public com.google.firestore.v1beta1.Document.Builder addDocsBuilder() { + return getDocsFieldBuilder().addBuilder( + com.google.firestore.v1beta1.Document.getDefaultInstance()); + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public com.google.firestore.v1beta1.Document.Builder addDocsBuilder( + int index) { + return getDocsFieldBuilder().addBuilder( + index, com.google.firestore.v1beta1.Document.getDefaultInstance()); + } + /** + * repeated .google.firestore.v1beta1.Document docs = 1; + */ + public java.util.List + getDocsBuilderList() { + return getDocsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1beta1.Document, com.google.firestore.v1beta1.Document.Builder, com.google.firestore.v1beta1.DocumentOrBuilder> + getDocsFieldBuilder() { + if (docsBuilder_ == null) { + docsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1beta1.Document, com.google.firestore.v1beta1.Document.Builder, com.google.firestore.v1beta1.DocumentOrBuilder>( + docs_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + docs_ = null; + } + return docsBuilder_; + } + + private java.util.List changes_ = + java.util.Collections.emptyList(); + private void ensureChangesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + changes_ = new java.util.ArrayList(changes_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.firestore.conformance.TestDefinition.DocChange, com.google.cloud.firestore.conformance.TestDefinition.DocChange.Builder, com.google.cloud.firestore.conformance.TestDefinition.DocChangeOrBuilder> changesBuilder_; + + /** + * repeated .tests.DocChange changes = 2; + */ + public java.util.List getChangesList() { + if (changesBuilder_ == null) { + return java.util.Collections.unmodifiableList(changes_); + } else { + return changesBuilder_.getMessageList(); + } + } + /** + * repeated .tests.DocChange changes = 2; + */ + public int getChangesCount() { + if (changesBuilder_ == null) { + return changes_.size(); + } else { + return changesBuilder_.getCount(); + } + } + /** + * repeated .tests.DocChange changes = 2; + */ + public com.google.cloud.firestore.conformance.TestDefinition.DocChange getChanges(int index) { + if (changesBuilder_ == null) { + return changes_.get(index); + } else { + return changesBuilder_.getMessage(index); + } + } + /** + * repeated .tests.DocChange changes = 2; + */ + public Builder setChanges( + int index, com.google.cloud.firestore.conformance.TestDefinition.DocChange value) { + if (changesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChangesIsMutable(); + changes_.set(index, value); + onChanged(); + } else { + changesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tests.DocChange changes = 2; + */ + public Builder setChanges( + int index, com.google.cloud.firestore.conformance.TestDefinition.DocChange.Builder builderForValue) { + if (changesBuilder_ == null) { + ensureChangesIsMutable(); + changes_.set(index, builderForValue.build()); + onChanged(); + } else { + changesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tests.DocChange changes = 2; + */ + public Builder addChanges(com.google.cloud.firestore.conformance.TestDefinition.DocChange value) { + if (changesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChangesIsMutable(); + changes_.add(value); + onChanged(); + } else { + changesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tests.DocChange changes = 2; + */ + public Builder addChanges( + int index, com.google.cloud.firestore.conformance.TestDefinition.DocChange value) { + if (changesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChangesIsMutable(); + changes_.add(index, value); + onChanged(); + } else { + changesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tests.DocChange changes = 2; + */ + public Builder addChanges( + com.google.cloud.firestore.conformance.TestDefinition.DocChange.Builder builderForValue) { + if (changesBuilder_ == null) { + ensureChangesIsMutable(); + changes_.add(builderForValue.build()); + onChanged(); + } else { + changesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tests.DocChange changes = 2; + */ + public Builder addChanges( + int index, com.google.cloud.firestore.conformance.TestDefinition.DocChange.Builder builderForValue) { + if (changesBuilder_ == null) { + ensureChangesIsMutable(); + changes_.add(index, builderForValue.build()); + onChanged(); + } else { + changesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tests.DocChange changes = 2; + */ + public Builder addAllChanges( + java.lang.Iterable values) { + if (changesBuilder_ == null) { + ensureChangesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, changes_); + onChanged(); + } else { + changesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tests.DocChange changes = 2; + */ + public Builder clearChanges() { + if (changesBuilder_ == null) { + changes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + changesBuilder_.clear(); + } + return this; + } + /** + * repeated .tests.DocChange changes = 2; + */ + public Builder removeChanges(int index) { + if (changesBuilder_ == null) { + ensureChangesIsMutable(); + changes_.remove(index); + onChanged(); + } else { + changesBuilder_.remove(index); + } + return this; + } + /** + * repeated .tests.DocChange changes = 2; + */ + public com.google.cloud.firestore.conformance.TestDefinition.DocChange.Builder getChangesBuilder( + int index) { + return getChangesFieldBuilder().getBuilder(index); + } + /** + * repeated .tests.DocChange changes = 2; + */ + public com.google.cloud.firestore.conformance.TestDefinition.DocChangeOrBuilder getChangesOrBuilder( + int index) { + if (changesBuilder_ == null) { + return changes_.get(index); } else { + return changesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tests.DocChange changes = 2; + */ + public java.util.List + getChangesOrBuilderList() { + if (changesBuilder_ != null) { + return changesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(changes_); + } + } + /** + * repeated .tests.DocChange changes = 2; + */ + public com.google.cloud.firestore.conformance.TestDefinition.DocChange.Builder addChangesBuilder() { + return getChangesFieldBuilder().addBuilder( + com.google.cloud.firestore.conformance.TestDefinition.DocChange.getDefaultInstance()); + } + /** + * repeated .tests.DocChange changes = 2; + */ + public com.google.cloud.firestore.conformance.TestDefinition.DocChange.Builder addChangesBuilder( + int index) { + return getChangesFieldBuilder().addBuilder( + index, com.google.cloud.firestore.conformance.TestDefinition.DocChange.getDefaultInstance()); + } + /** + * repeated .tests.DocChange changes = 2; + */ + public java.util.List + getChangesBuilderList() { + return getChangesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.firestore.conformance.TestDefinition.DocChange, com.google.cloud.firestore.conformance.TestDefinition.DocChange.Builder, com.google.cloud.firestore.conformance.TestDefinition.DocChangeOrBuilder> + getChangesFieldBuilder() { + if (changesBuilder_ == null) { + changesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.firestore.conformance.TestDefinition.DocChange, com.google.cloud.firestore.conformance.TestDefinition.DocChange.Builder, com.google.cloud.firestore.conformance.TestDefinition.DocChangeOrBuilder>( + changes_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + changes_ = null; + } + return changesBuilder_; + } + + private com.google.protobuf.Timestamp readTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> readTimeBuilder_; + /** + * .google.protobuf.Timestamp read_time = 3; + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * .google.protobuf.Timestamp read_time = 3; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * .google.protobuf.Timestamp read_time = 3; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * .google.protobuf.Timestamp read_time = 3; + */ + public Builder setReadTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .google.protobuf.Timestamp read_time = 3; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .google.protobuf.Timestamp read_time = 3; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * .google.protobuf.Timestamp read_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * .google.protobuf.Timestamp read_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * .google.protobuf.Timestamp read_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getReadTime(), + getParentForChildren(), + isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:tests.Snapshot) + } + + // @@protoc_insertion_point(class_scope:tests.Snapshot) + private static final com.google.cloud.firestore.conformance.TestDefinition.Snapshot DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.firestore.conformance.TestDefinition.Snapshot(); + } + + public static com.google.cloud.firestore.conformance.TestDefinition.Snapshot getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Snapshot parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Snapshot(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.firestore.conformance.TestDefinition.Snapshot getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DocChangeOrBuilder extends + // @@protoc_insertion_point(interface_extends:tests.DocChange) + com.google.protobuf.MessageOrBuilder { + + /** + * .tests.DocChange.Kind kind = 1; + */ + int getKindValue(); + /** + * .tests.DocChange.Kind kind = 1; + */ + com.google.cloud.firestore.conformance.TestDefinition.DocChange.Kind getKind(); + + /** + * .google.firestore.v1beta1.Document doc = 2; + */ + boolean hasDoc(); + /** + * .google.firestore.v1beta1.Document doc = 2; + */ + com.google.firestore.v1beta1.Document getDoc(); + /** + * .google.firestore.v1beta1.Document doc = 2; + */ + com.google.firestore.v1beta1.DocumentOrBuilder getDocOrBuilder(); + + /** + * int32 old_index = 3; + */ + int getOldIndex(); + + /** + * int32 new_index = 4; + */ + int getNewIndex(); + } + /** + * Protobuf type {@code tests.DocChange} + */ + public static final class DocChange extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:tests.DocChange) + DocChangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocChange.newBuilder() to construct. + private DocChange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DocChange() { + kind_ = 0; + oldIndex_ = 0; + newIndex_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DocChange( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + + kind_ = rawValue; + break; + } + case 18: { + com.google.firestore.v1beta1.Document.Builder subBuilder = null; + if (doc_ != null) { + subBuilder = doc_.toBuilder(); + } + doc_ = input.readMessage(com.google.firestore.v1beta1.Document.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(doc_); + doc_ = subBuilder.buildPartial(); + } + + break; + } + case 24: { + + oldIndex_ = input.readInt32(); + break; + } + case 32: { + + newIndex_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.firestore.conformance.TestDefinition.internal_static_tests_DocChange_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.firestore.conformance.TestDefinition.internal_static_tests_DocChange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.firestore.conformance.TestDefinition.DocChange.class, com.google.cloud.firestore.conformance.TestDefinition.DocChange.Builder.class); + } + + /** + * Protobuf enum {@code tests.DocChange.Kind} + */ + public enum Kind + implements com.google.protobuf.ProtocolMessageEnum { + /** + * KIND_UNSPECIFIED = 0; + */ + KIND_UNSPECIFIED(0), + /** + * ADDED = 1; + */ + ADDED(1), + /** + * REMOVED = 2; + */ + REMOVED(2), + /** + * MODIFIED = 3; + */ + MODIFIED(3), + UNRECOGNIZED(-1), + ; + + /** + * KIND_UNSPECIFIED = 0; + */ + public static final int KIND_UNSPECIFIED_VALUE = 0; + /** + * ADDED = 1; + */ + public static final int ADDED_VALUE = 1; + /** + * REMOVED = 2; + */ + public static final int REMOVED_VALUE = 2; + /** + * MODIFIED = 3; + */ + public static final int MODIFIED_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Kind valueOf(int value) { + return forNumber(value); + } + + public static Kind forNumber(int value) { + switch (value) { + case 0: return KIND_UNSPECIFIED; + case 1: return ADDED; + case 2: return REMOVED; + case 3: return MODIFIED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Kind> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Kind findValueByNumber(int number) { + return Kind.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.firestore.conformance.TestDefinition.DocChange.getDescriptor().getEnumTypes().get(0); + } + + private static final Kind[] VALUES = values(); + + public static Kind valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Kind(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tests.DocChange.Kind) + } + + public static final int KIND_FIELD_NUMBER = 1; + private int kind_; + /** + * .tests.DocChange.Kind kind = 1; + */ + public int getKindValue() { + return kind_; + } + /** + * .tests.DocChange.Kind kind = 1; + */ + public com.google.cloud.firestore.conformance.TestDefinition.DocChange.Kind getKind() { + com.google.cloud.firestore.conformance.TestDefinition.DocChange.Kind result = com.google.cloud.firestore.conformance.TestDefinition.DocChange.Kind.valueOf(kind_); + return result == null ? com.google.cloud.firestore.conformance.TestDefinition.DocChange.Kind.UNRECOGNIZED : result; + } + + public static final int DOC_FIELD_NUMBER = 2; + private com.google.firestore.v1beta1.Document doc_; + /** + * .google.firestore.v1beta1.Document doc = 2; + */ + public boolean hasDoc() { + return doc_ != null; + } + /** + * .google.firestore.v1beta1.Document doc = 2; + */ + public com.google.firestore.v1beta1.Document getDoc() { + return doc_ == null ? com.google.firestore.v1beta1.Document.getDefaultInstance() : doc_; + } + /** + * .google.firestore.v1beta1.Document doc = 2; + */ + public com.google.firestore.v1beta1.DocumentOrBuilder getDocOrBuilder() { + return getDoc(); + } + + public static final int OLD_INDEX_FIELD_NUMBER = 3; + private int oldIndex_; + /** + * int32 old_index = 3; + */ + public int getOldIndex() { + return oldIndex_; + } + + public static final int NEW_INDEX_FIELD_NUMBER = 4; + private int newIndex_; + /** + * int32 new_index = 4; + */ + public int getNewIndex() { + return newIndex_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (kind_ != com.google.cloud.firestore.conformance.TestDefinition.DocChange.Kind.KIND_UNSPECIFIED.getNumber()) { + output.writeEnum(1, kind_); + } + if (doc_ != null) { + output.writeMessage(2, getDoc()); + } + if (oldIndex_ != 0) { + output.writeInt32(3, oldIndex_); + } + if (newIndex_ != 0) { + output.writeInt32(4, newIndex_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kind_ != com.google.cloud.firestore.conformance.TestDefinition.DocChange.Kind.KIND_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, kind_); + } + if (doc_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getDoc()); + } + if (oldIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, oldIndex_); + } + if (newIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, newIndex_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.firestore.conformance.TestDefinition.DocChange)) { + return super.equals(obj); + } + com.google.cloud.firestore.conformance.TestDefinition.DocChange other = (com.google.cloud.firestore.conformance.TestDefinition.DocChange) obj; + + boolean result = true; + result = result && kind_ == other.kind_; + result = result && (hasDoc() == other.hasDoc()); + if (hasDoc()) { + result = result && getDoc() + .equals(other.getDoc()); + } + result = result && (getOldIndex() + == other.getOldIndex()); + result = result && (getNewIndex() + == other.getNewIndex()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + kind_; + if (hasDoc()) { + hash = (37 * hash) + DOC_FIELD_NUMBER; + hash = (53 * hash) + getDoc().hashCode(); + } + hash = (37 * hash) + OLD_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getOldIndex(); + hash = (37 * hash) + NEW_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getNewIndex(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.firestore.conformance.TestDefinition.DocChange parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.firestore.conformance.TestDefinition.DocChange parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.firestore.conformance.TestDefinition.DocChange parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.firestore.conformance.TestDefinition.DocChange parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.firestore.conformance.TestDefinition.DocChange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.firestore.conformance.TestDefinition.DocChange parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.firestore.conformance.TestDefinition.DocChange parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.firestore.conformance.TestDefinition.DocChange parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.firestore.conformance.TestDefinition.DocChange parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.firestore.conformance.TestDefinition.DocChange parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.firestore.conformance.TestDefinition.DocChange parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.firestore.conformance.TestDefinition.DocChange parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.firestore.conformance.TestDefinition.DocChange prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tests.DocChange} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:tests.DocChange) + com.google.cloud.firestore.conformance.TestDefinition.DocChangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.firestore.conformance.TestDefinition.internal_static_tests_DocChange_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.firestore.conformance.TestDefinition.internal_static_tests_DocChange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.firestore.conformance.TestDefinition.DocChange.class, com.google.cloud.firestore.conformance.TestDefinition.DocChange.Builder.class); + } + + // Construct using com.google.cloud.firestore.conformance.TestDefinition.DocChange.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + kind_ = 0; + + if (docBuilder_ == null) { + doc_ = null; + } else { + doc_ = null; + docBuilder_ = null; + } + oldIndex_ = 0; + + newIndex_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.firestore.conformance.TestDefinition.internal_static_tests_DocChange_descriptor; + } + + public com.google.cloud.firestore.conformance.TestDefinition.DocChange getDefaultInstanceForType() { + return com.google.cloud.firestore.conformance.TestDefinition.DocChange.getDefaultInstance(); + } + + public com.google.cloud.firestore.conformance.TestDefinition.DocChange build() { + com.google.cloud.firestore.conformance.TestDefinition.DocChange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.cloud.firestore.conformance.TestDefinition.DocChange buildPartial() { + com.google.cloud.firestore.conformance.TestDefinition.DocChange result = new com.google.cloud.firestore.conformance.TestDefinition.DocChange(this); + result.kind_ = kind_; + if (docBuilder_ == null) { + result.doc_ = doc_; + } else { + result.doc_ = docBuilder_.build(); + } + result.oldIndex_ = oldIndex_; + result.newIndex_ = newIndex_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.firestore.conformance.TestDefinition.DocChange) { + return mergeFrom((com.google.cloud.firestore.conformance.TestDefinition.DocChange)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.firestore.conformance.TestDefinition.DocChange other) { + if (other == com.google.cloud.firestore.conformance.TestDefinition.DocChange.getDefaultInstance()) return this; + if (other.kind_ != 0) { + setKindValue(other.getKindValue()); + } + if (other.hasDoc()) { + mergeDoc(other.getDoc()); + } + if (other.getOldIndex() != 0) { + setOldIndex(other.getOldIndex()); + } + if (other.getNewIndex() != 0) { + setNewIndex(other.getNewIndex()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.firestore.conformance.TestDefinition.DocChange parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.firestore.conformance.TestDefinition.DocChange) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int kind_ = 0; + /** + * .tests.DocChange.Kind kind = 1; + */ + public int getKindValue() { + return kind_; + } + /** + * .tests.DocChange.Kind kind = 1; + */ + public Builder setKindValue(int value) { + kind_ = value; + onChanged(); + return this; + } + /** + * .tests.DocChange.Kind kind = 1; + */ + public com.google.cloud.firestore.conformance.TestDefinition.DocChange.Kind getKind() { + com.google.cloud.firestore.conformance.TestDefinition.DocChange.Kind result = com.google.cloud.firestore.conformance.TestDefinition.DocChange.Kind.valueOf(kind_); + return result == null ? com.google.cloud.firestore.conformance.TestDefinition.DocChange.Kind.UNRECOGNIZED : result; + } + /** + * .tests.DocChange.Kind kind = 1; + */ + public Builder setKind(com.google.cloud.firestore.conformance.TestDefinition.DocChange.Kind value) { + if (value == null) { + throw new NullPointerException(); + } + + kind_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tests.DocChange.Kind kind = 1; + */ + public Builder clearKind() { + + kind_ = 0; + onChanged(); + return this; + } + + private com.google.firestore.v1beta1.Document doc_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.Document, com.google.firestore.v1beta1.Document.Builder, com.google.firestore.v1beta1.DocumentOrBuilder> docBuilder_; + /** + * .google.firestore.v1beta1.Document doc = 2; + */ + public boolean hasDoc() { + return docBuilder_ != null || doc_ != null; + } + /** + * .google.firestore.v1beta1.Document doc = 2; + */ + public com.google.firestore.v1beta1.Document getDoc() { + if (docBuilder_ == null) { + return doc_ == null ? com.google.firestore.v1beta1.Document.getDefaultInstance() : doc_; + } else { + return docBuilder_.getMessage(); + } + } + /** + * .google.firestore.v1beta1.Document doc = 2; + */ + public Builder setDoc(com.google.firestore.v1beta1.Document value) { + if (docBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + doc_ = value; + onChanged(); + } else { + docBuilder_.setMessage(value); + } + + return this; + } + /** + * .google.firestore.v1beta1.Document doc = 2; + */ + public Builder setDoc( + com.google.firestore.v1beta1.Document.Builder builderForValue) { + if (docBuilder_ == null) { + doc_ = builderForValue.build(); + onChanged(); + } else { + docBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .google.firestore.v1beta1.Document doc = 2; + */ + public Builder mergeDoc(com.google.firestore.v1beta1.Document value) { + if (docBuilder_ == null) { + if (doc_ != null) { + doc_ = + com.google.firestore.v1beta1.Document.newBuilder(doc_).mergeFrom(value).buildPartial(); + } else { + doc_ = value; + } + onChanged(); + } else { + docBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .google.firestore.v1beta1.Document doc = 2; + */ + public Builder clearDoc() { + if (docBuilder_ == null) { + doc_ = null; + onChanged(); + } else { + doc_ = null; + docBuilder_ = null; + } + + return this; + } + /** + * .google.firestore.v1beta1.Document doc = 2; + */ + public com.google.firestore.v1beta1.Document.Builder getDocBuilder() { + + onChanged(); + return getDocFieldBuilder().getBuilder(); + } + /** + * .google.firestore.v1beta1.Document doc = 2; + */ + public com.google.firestore.v1beta1.DocumentOrBuilder getDocOrBuilder() { + if (docBuilder_ != null) { + return docBuilder_.getMessageOrBuilder(); + } else { + return doc_ == null ? + com.google.firestore.v1beta1.Document.getDefaultInstance() : doc_; + } + } + /** + * .google.firestore.v1beta1.Document doc = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.Document, com.google.firestore.v1beta1.Document.Builder, com.google.firestore.v1beta1.DocumentOrBuilder> + getDocFieldBuilder() { + if (docBuilder_ == null) { + docBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.Document, com.google.firestore.v1beta1.Document.Builder, com.google.firestore.v1beta1.DocumentOrBuilder>( + getDoc(), + getParentForChildren(), + isClean()); + doc_ = null; + } + return docBuilder_; + } + + private int oldIndex_ ; + /** + * int32 old_index = 3; + */ + public int getOldIndex() { + return oldIndex_; + } + /** + * int32 old_index = 3; + */ + public Builder setOldIndex(int value) { + + oldIndex_ = value; + onChanged(); + return this; + } + /** + * int32 old_index = 3; + */ + public Builder clearOldIndex() { + + oldIndex_ = 0; + onChanged(); + return this; + } + + private int newIndex_ ; + /** + * int32 new_index = 4; + */ + public int getNewIndex() { + return newIndex_; + } + /** + * int32 new_index = 4; + */ + public Builder setNewIndex(int value) { + + newIndex_ = value; + onChanged(); + return this; + } + /** + * int32 new_index = 4; + */ + public Builder clearNewIndex() { + + newIndex_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:tests.DocChange) + } + + // @@protoc_insertion_point(class_scope:tests.DocChange) + private static final com.google.cloud.firestore.conformance.TestDefinition.DocChange DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.firestore.conformance.TestDefinition.DocChange(); + } + + public static com.google.cloud.firestore.conformance.TestDefinition.DocChange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public DocChange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DocChange(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.cloud.firestore.conformance.TestDefinition.DocChange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_TestSuite_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_TestSuite_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_Test_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_Test_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_GetTest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_GetTest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_CreateTest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_CreateTest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_SetTest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_SetTest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_UpdateTest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_UpdateTest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_UpdatePathsTest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_UpdatePathsTest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_DeleteTest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_DeleteTest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_SetOption_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_SetOption_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_QueryTest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_QueryTest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_Clause_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_Clause_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_Select_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_Select_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_Where_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_Where_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_OrderBy_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_OrderBy_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_Cursor_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_Cursor_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_DocSnapshot_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_DocSnapshot_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_FieldPath_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_FieldPath_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_ListenTest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_ListenTest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_Snapshot_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_Snapshot_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tests_DocChange_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tests_DocChange_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\025test-definition.proto\022\005tests\032%google/f" + + "irestore/v1beta1/common.proto\032\'google/fi" + + "restore/v1beta1/document.proto\032(google/f" + + "irestore/v1beta1/firestore.proto\032$google" + + "/firestore/v1beta1/query.proto\032\037google/p" + + "rotobuf/timestamp.proto\"\'\n\tTestSuite\022\032\n\005" + + "tests\030\001 \003(\0132\013.tests.Test\"\310\002\n\004Test\022\023\n\013des" + + "cription\030\001 \001(\t\022\035\n\003get\030\002 \001(\0132\016.tests.GetT" + + "estH\000\022#\n\006create\030\003 \001(\0132\021.tests.CreateTest" + + "H\000\022\035\n\003set\030\004 \001(\0132\016.tests.SetTestH\000\022#\n\006upd" + + "ate\030\005 \001(\0132\021.tests.UpdateTestH\000\022.\n\014update" + + "_paths\030\006 \001(\0132\026.tests.UpdatePathsTestH\000\022#" + + "\n\006delete\030\007 \001(\0132\021.tests.DeleteTestH\000\022!\n\005q" + + "uery\030\010 \001(\0132\020.tests.QueryTestH\000\022#\n\006listen" + + "\030\t \001(\0132\021.tests.ListenTestH\000B\006\n\004test\"^\n\007G" + + "etTest\022\024\n\014doc_ref_path\030\001 \001(\t\022=\n\007request\030" + + "\002 \001(\0132,.google.firestore.v1beta1.GetDocu" + + "mentRequest\"\201\001\n\nCreateTest\022\024\n\014doc_ref_pa" + + "th\030\001 \001(\t\022\021\n\tjson_data\030\002 \001(\t\0228\n\007request\030\003" + + " \001(\0132\'.google.firestore.v1beta1.CommitRe" + + "quest\022\020\n\010is_error\030\004 \001(\010\"\240\001\n\007SetTest\022\024\n\014d" + + "oc_ref_path\030\001 \001(\t\022 \n\006option\030\002 \001(\0132\020.test" + + "s.SetOption\022\021\n\tjson_data\030\003 \001(\t\0228\n\007reques" + + "t\030\004 \001(\0132\'.google.firestore.v1beta1.Commi" + + "tRequest\022\020\n\010is_error\030\005 \001(\010\"\277\001\n\nUpdateTes" + + "t\022\024\n\014doc_ref_path\030\001 \001(\t\022<\n\014precondition\030" + + "\002 \001(\0132&.google.firestore.v1beta1.Precond" + + "ition\022\021\n\tjson_data\030\003 \001(\t\0228\n\007request\030\004 \001(" + + "\0132\'.google.firestore.v1beta1.CommitReque" + + "st\022\020\n\010is_error\030\005 \001(\010\"\355\001\n\017UpdatePathsTest" + + "\022\024\n\014doc_ref_path\030\001 \001(\t\022<\n\014precondition\030\002" + + " \001(\0132&.google.firestore.v1beta1.Precondi" + + "tion\022%\n\013field_paths\030\003 \003(\0132\020.tests.FieldP" + + "ath\022\023\n\013json_values\030\004 \003(\t\0228\n\007request\030\005 \001(" + + "\0132\'.google.firestore.v1beta1.CommitReque" + + "st\022\020\n\010is_error\030\006 \001(\010\"\254\001\n\nDeleteTest\022\024\n\014d" + + "oc_ref_path\030\001 \001(\t\022<\n\014precondition\030\002 \001(\0132" + + "&.google.firestore.v1beta1.Precondition\022" + + "8\n\007request\030\003 \001(\0132\'.google.firestore.v1be" + + "ta1.CommitRequest\022\020\n\010is_error\030\004 \001(\010\":\n\tS" + + "etOption\022\013\n\003all\030\001 \001(\010\022 \n\006fields\030\002 \003(\0132\020." + + "tests.FieldPath\"\212\001\n\tQueryTest\022\021\n\tcoll_pa" + + "th\030\001 \001(\t\022\036\n\007clauses\030\002 \003(\0132\r.tests.Clause" + + "\0228\n\005query\030\003 \001(\0132).google.firestore.v1bet" + + "a1.StructuredQuery\022\020\n\010is_error\030\004 \001(\010\"\250\002\n" + + "\006Clause\022\037\n\006select\030\001 \001(\0132\r.tests.SelectH\000" + + "\022\035\n\005where\030\002 \001(\0132\014.tests.WhereH\000\022\"\n\010order" + + "_by\030\003 \001(\0132\016.tests.OrderByH\000\022\020\n\006offset\030\004 " + + "\001(\005H\000\022\017\n\005limit\030\005 \001(\005H\000\022!\n\010start_at\030\006 \001(\013" + + "2\r.tests.CursorH\000\022$\n\013start_after\030\007 \001(\0132\r" + + ".tests.CursorH\000\022\037\n\006end_at\030\010 \001(\0132\r.tests." + + "CursorH\000\022#\n\nend_before\030\t \001(\0132\r.tests.Cur" + + "sorH\000B\010\n\006clause\"*\n\006Select\022 \n\006fields\030\001 \003(" + + "\0132\020.tests.FieldPath\"G\n\005Where\022\036\n\004path\030\001 \001" + + "(\0132\020.tests.FieldPath\022\n\n\002op\030\002 \001(\t\022\022\n\njson" + + "_value\030\003 \001(\t\"<\n\007OrderBy\022\036\n\004path\030\001 \001(\0132\020." + + "tests.FieldPath\022\021\n\tdirection\030\002 \001(\t\"G\n\006Cu" + + "rsor\022(\n\014doc_snapshot\030\001 \001(\0132\022.tests.DocSn" + + "apshot\022\023\n\013json_values\030\002 \003(\t\".\n\013DocSnapsh" + + "ot\022\014\n\004path\030\001 \001(\t\022\021\n\tjson_data\030\002 \001(\t\"\032\n\tF" + + "ieldPath\022\r\n\005field\030\001 \003(\t\"\177\n\nListenTest\022;\n" + + "\tresponses\030\001 \003(\0132(.google.firestore.v1be" + + "ta1.ListenResponse\022\"\n\tsnapshots\030\002 \003(\0132\017." + + "tests.Snapshot\022\020\n\010is_error\030\003 \001(\010\"\216\001\n\010Sna" + + "pshot\0220\n\004docs\030\001 \003(\0132\".google.firestore.v" + + "1beta1.Document\022!\n\007changes\030\002 \003(\0132\020.tests" + + ".DocChange\022-\n\tread_time\030\003 \001(\0132\032.google.p" + + "rotobuf.Timestamp\"\313\001\n\tDocChange\022#\n\004kind\030" + + "\001 \001(\0162\025.tests.DocChange.Kind\022/\n\003doc\030\002 \001(" + + "\0132\".google.firestore.v1beta1.Document\022\021\n" + + "\told_index\030\003 \001(\005\022\021\n\tnew_index\030\004 \001(\005\"B\n\004K" + + "ind\022\024\n\020KIND_UNSPECIFIED\020\000\022\t\n\005ADDED\020\001\022\013\n\007" + + "REMOVED\020\002\022\014\n\010MODIFIED\020\003Bx\n&com.google.cl" + + "oud.firestore.conformance\252\002\"Google.Cloud" + + ".Firestore.Tests.Proto\312\002(Google\\Cloud\\Fi" + + "restore\\Tests\\Conformanceb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.firestore.v1beta1.CommonProto.getDescriptor(), + com.google.firestore.v1beta1.DocumentProto.getDescriptor(), + com.google.firestore.v1beta1.FirestoreProto.getDescriptor(), + com.google.firestore.v1beta1.QueryProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, assigner); + internal_static_tests_TestSuite_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tests_TestSuite_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tests_TestSuite_descriptor, new java.lang.String[] { "Tests", }); internal_static_tests_Test_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_tests_Test_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_tests_Test_descriptor, - new java.lang.String[] { "Description", "Get", "Create", "Set", "Update", "UpdatePaths", "Delete", "Query", "Test", }); + new java.lang.String[] { "Description", "Get", "Create", "Set", "Update", "UpdatePaths", "Delete", "Query", "Listen", "Test", }); internal_static_tests_GetTest_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_tests_GetTest_fieldAccessorTable = new @@ -19557,9 +23259,29 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_tests_FieldPath_descriptor, new java.lang.String[] { "Field", }); - com.google.firestore.v1beta1.FirestoreProto.getDescriptor(); + internal_static_tests_ListenTest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_tests_ListenTest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tests_ListenTest_descriptor, + new java.lang.String[] { "Responses", "Snapshots", "IsError", }); + internal_static_tests_Snapshot_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_tests_Snapshot_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tests_Snapshot_descriptor, + new java.lang.String[] { "Docs", "Changes", "ReadTime", }); + internal_static_tests_DocChange_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_tests_DocChange_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tests_DocChange_descriptor, + new java.lang.String[] { "Kind", "Doc", "OldIndex", "NewIndex", }); com.google.firestore.v1beta1.CommonProto.getDescriptor(); + com.google.firestore.v1beta1.DocumentProto.getDescriptor(); + com.google.firestore.v1beta1.FirestoreProto.getDescriptor(); com.google.firestore.v1beta1.QueryProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/google-cloud-firestore/src/test/resources/test-suite.binproto b/google-cloud-firestore/src/test/resources/test-suite.binproto index 6ed663ef9663..917804995759 100644 Binary files a/google-cloud-firestore/src/test/resources/test-suite.binproto and b/google-cloud-firestore/src/test/resources/test-suite.binproto differ