@Test public void testEncodesListenRequestLabels() { Query query = query("collection/key"); TargetData targetData = new TargetData(query.toTarget(), 2, 3, QueryPurpose.LISTEN); Map<String, String> result = serializer.encodeListenRequestLabels(targetData); assertNull(result); targetData = new TargetData(query.toTarget(), 2, 3, QueryPurpose.LIMBO_RESOLUTION); result = serializer.encodeListenRequestLabels(targetData); assertEquals(map("goog-listen-tags", "limbo-document"), result); targetData = new TargetData(query.toTarget(), 2, 3, QueryPurpose.EXISTENCE_FILTER_MISMATCH); result = serializer.encodeListenRequestLabels(targetData); assertEquals(map("goog-listen-tags", "existence-filter-mismatch"), result); }
@Nullable public Map<String, String> encodeListenRequestLabels(TargetData targetData) { @Nullable String value = encodeLabel(targetData.getPurpose()); if (value == null) { return null; } Map<String, String> result = new HashMap<>(1); result.put("goog-listen-tags", value); return result; }
RemoteSerializer { @Nullable public Map<String, String> encodeListenRequestLabels(TargetData targetData) { @Nullable String value = encodeLabel(targetData.getPurpose()); if (value == null) { return null; } Map<String, String> result = new HashMap<>(1); result.put("goog-listen-tags", value); return result; } }
RemoteSerializer { @Nullable public Map<String, String> encodeListenRequestLabels(TargetData targetData) { @Nullable String value = encodeLabel(targetData.getPurpose()); if (value == null) { return null; } Map<String, String> result = new HashMap<>(1); result.put("goog-listen-tags", value); return result; } RemoteSerializer(DatabaseId databaseId); }
RemoteSerializer { @Nullable public Map<String, String> encodeListenRequestLabels(TargetData targetData) { @Nullable String value = encodeLabel(targetData.getPurpose()); if (value == null) { return null; } Map<String, String> result = new HashMap<>(1); result.put("goog-listen-tags", value); return result; } RemoteSerializer(DatabaseId databaseId); com.google.protobuf.Timestamp encodeTimestamp(Timestamp timestamp); Timestamp decodeTimestamp(com.google.protobuf.Timestamp proto); com.google.protobuf.Timestamp encodeVersion(SnapshotVersion version); SnapshotVersion decodeVersion(com.google.protobuf.Timestamp proto); String encodeKey(DocumentKey key); DocumentKey decodeKey(String name); String databaseName(); com.google.firestore.v1.Document encodeDocument(DocumentKey key, ObjectValue value); MaybeDocument decodeMaybeDocument(BatchGetDocumentsResponse response); com.google.firestore.v1.Write encodeMutation(Mutation mutation); Mutation decodeMutation(com.google.firestore.v1.Write mutation); MutationResult decodeMutationResult(
      com.google.firestore.v1.WriteResult proto, SnapshotVersion commitVersion); @Nullable Map<String, String> encodeListenRequestLabels(TargetData targetData); Target encodeTarget(TargetData targetData); DocumentsTarget encodeDocumentsTarget(com.google.firebase.firestore.core.Target target); com.google.firebase.firestore.core.Target decodeDocumentsTarget(DocumentsTarget target); QueryTarget encodeQueryTarget(com.google.firebase.firestore.core.Target target); com.google.firebase.firestore.core.Target decodeQueryTarget(QueryTarget target); WatchChange decodeWatchChange(ListenResponse protoChange); SnapshotVersion decodeVersionFromListenResponse(ListenResponse watchChange); }
RemoteSerializer { @Nullable public Map<String, String> encodeListenRequestLabels(TargetData targetData) { @Nullable String value = encodeLabel(targetData.getPurpose()); if (value == null) { return null; } Map<String, String> result = new HashMap<>(1); result.put("goog-listen-tags", value); return result; } RemoteSerializer(DatabaseId databaseId); com.google.protobuf.Timestamp encodeTimestamp(Timestamp timestamp); Timestamp decodeTimestamp(com.google.protobuf.Timestamp proto); com.google.protobuf.Timestamp encodeVersion(SnapshotVersion version); SnapshotVersion decodeVersion(com.google.protobuf.Timestamp proto); String encodeKey(DocumentKey key); DocumentKey decodeKey(String name); String databaseName(); com.google.firestore.v1.Document encodeDocument(DocumentKey key, ObjectValue value); MaybeDocument decodeMaybeDocument(BatchGetDocumentsResponse response); com.google.firestore.v1.Write encodeMutation(Mutation mutation); Mutation decodeMutation(com.google.firestore.v1.Write mutation); MutationResult decodeMutationResult(
      com.google.firestore.v1.WriteResult proto, SnapshotVersion commitVersion); @Nullable Map<String, String> encodeListenRequestLabels(TargetData targetData); Target encodeTarget(TargetData targetData); DocumentsTarget encodeDocumentsTarget(com.google.firebase.firestore.core.Target target); com.google.firebase.firestore.core.Target decodeDocumentsTarget(DocumentsTarget target); QueryTarget encodeQueryTarget(com.google.firebase.firestore.core.Target target); com.google.firebase.firestore.core.Target decodeQueryTarget(QueryTarget target); WatchChange decodeWatchChange(ListenResponse protoChange); SnapshotVersion decodeVersionFromListenResponse(ListenResponse watchChange);  }