com.google.datastore.v1.QueryResultBatch Maven / Gradle / Ivy
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/datastore/v1/query.proto
package com.google.datastore.v1;
/**
*
*
*
* A batch of results produced by a query.
*
*
* Protobuf type {@code google.datastore.v1.QueryResultBatch}
*/
public final class QueryResultBatch extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.datastore.v1.QueryResultBatch)
QueryResultBatchOrBuilder {
private static final long serialVersionUID = 0L;
// Use QueryResultBatch.newBuilder() to construct.
private QueryResultBatch(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private QueryResultBatch() {
skippedCursor_ = com.google.protobuf.ByteString.EMPTY;
entityResultType_ = 0;
entityResults_ = java.util.Collections.emptyList();
endCursor_ = com.google.protobuf.ByteString.EMPTY;
moreResults_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new QueryResultBatch();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.datastore.v1.QueryProto
.internal_static_google_datastore_v1_QueryResultBatch_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.datastore.v1.QueryProto
.internal_static_google_datastore_v1_QueryResultBatch_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.datastore.v1.QueryResultBatch.class,
com.google.datastore.v1.QueryResultBatch.Builder.class);
}
/**
*
*
*
* The possible values for the `more_results` field.
*
*
* Protobuf enum {@code google.datastore.v1.QueryResultBatch.MoreResultsType}
*/
public enum MoreResultsType implements com.google.protobuf.ProtocolMessageEnum {
/**
*
*
*
* Unspecified. This value is never used.
*
*
* MORE_RESULTS_TYPE_UNSPECIFIED = 0;
*/
MORE_RESULTS_TYPE_UNSPECIFIED(0),
/**
*
*
*
* There may be additional batches to fetch from this query.
*
*
* NOT_FINISHED = 1;
*/
NOT_FINISHED(1),
/**
*
*
*
* The query is finished, but there may be more results after the limit.
*
*
* MORE_RESULTS_AFTER_LIMIT = 2;
*/
MORE_RESULTS_AFTER_LIMIT(2),
/**
*
*
*
* The query is finished, but there may be more results after the end
* cursor.
*
*
* MORE_RESULTS_AFTER_CURSOR = 4;
*/
MORE_RESULTS_AFTER_CURSOR(4),
/**
*
*
*
* The query is finished, and there are no more results.
*
*
* NO_MORE_RESULTS = 3;
*/
NO_MORE_RESULTS(3),
UNRECOGNIZED(-1),
;
/**
*
*
*
* Unspecified. This value is never used.
*
*
* MORE_RESULTS_TYPE_UNSPECIFIED = 0;
*/
public static final int MORE_RESULTS_TYPE_UNSPECIFIED_VALUE = 0;
/**
*
*
*
* There may be additional batches to fetch from this query.
*
*
* NOT_FINISHED = 1;
*/
public static final int NOT_FINISHED_VALUE = 1;
/**
*
*
*
* The query is finished, but there may be more results after the limit.
*
*
* MORE_RESULTS_AFTER_LIMIT = 2;
*/
public static final int MORE_RESULTS_AFTER_LIMIT_VALUE = 2;
/**
*
*
*
* The query is finished, but there may be more results after the end
* cursor.
*
*
* MORE_RESULTS_AFTER_CURSOR = 4;
*/
public static final int MORE_RESULTS_AFTER_CURSOR_VALUE = 4;
/**
*
*
*
* The query is finished, and there are no more results.
*
*
* NO_MORE_RESULTS = 3;
*/
public static final int NO_MORE_RESULTS_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;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static MoreResultsType valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static MoreResultsType forNumber(int value) {
switch (value) {
case 0:
return MORE_RESULTS_TYPE_UNSPECIFIED;
case 1:
return NOT_FINISHED;
case 2:
return MORE_RESULTS_AFTER_LIMIT;
case 4:
return MORE_RESULTS_AFTER_CURSOR;
case 3:
return NO_MORE_RESULTS;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public MoreResultsType findValueByNumber(int number) {
return MoreResultsType.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
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.datastore.v1.QueryResultBatch.getDescriptor().getEnumTypes().get(0);
}
private static final MoreResultsType[] VALUES = values();
public static MoreResultsType 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 MoreResultsType(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.datastore.v1.QueryResultBatch.MoreResultsType)
}
public static final int SKIPPED_RESULTS_FIELD_NUMBER = 6;
private int skippedResults_ = 0;
/**
*
*
*
* The number of results skipped, typically because of an offset.
*
*
* int32 skipped_results = 6;
*
* @return The skippedResults.
*/
@java.lang.Override
public int getSkippedResults() {
return skippedResults_;
}
public static final int SKIPPED_CURSOR_FIELD_NUMBER = 3;
private com.google.protobuf.ByteString skippedCursor_ = com.google.protobuf.ByteString.EMPTY;
/**
*
*
*
* A cursor that points to the position after the last skipped result.
* Will be set when `skipped_results` != 0.
*
*
* bytes skipped_cursor = 3;
*
* @return The skippedCursor.
*/
@java.lang.Override
public com.google.protobuf.ByteString getSkippedCursor() {
return skippedCursor_;
}
public static final int ENTITY_RESULT_TYPE_FIELD_NUMBER = 1;
private int entityResultType_ = 0;
/**
*
*
*
* The result type for every entity in `entity_results`.
*
*
* .google.datastore.v1.EntityResult.ResultType entity_result_type = 1;
*
* @return The enum numeric value on the wire for entityResultType.
*/
@java.lang.Override
public int getEntityResultTypeValue() {
return entityResultType_;
}
/**
*
*
*
* The result type for every entity in `entity_results`.
*
*
* .google.datastore.v1.EntityResult.ResultType entity_result_type = 1;
*
* @return The entityResultType.
*/
@java.lang.Override
public com.google.datastore.v1.EntityResult.ResultType getEntityResultType() {
com.google.datastore.v1.EntityResult.ResultType result =
com.google.datastore.v1.EntityResult.ResultType.forNumber(entityResultType_);
return result == null ? com.google.datastore.v1.EntityResult.ResultType.UNRECOGNIZED : result;
}
public static final int ENTITY_RESULTS_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private java.util.List entityResults_;
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
@java.lang.Override
public java.util.List getEntityResultsList() {
return entityResults_;
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
@java.lang.Override
public java.util.List extends com.google.datastore.v1.EntityResultOrBuilder>
getEntityResultsOrBuilderList() {
return entityResults_;
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
@java.lang.Override
public int getEntityResultsCount() {
return entityResults_.size();
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
@java.lang.Override
public com.google.datastore.v1.EntityResult getEntityResults(int index) {
return entityResults_.get(index);
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
@java.lang.Override
public com.google.datastore.v1.EntityResultOrBuilder getEntityResultsOrBuilder(int index) {
return entityResults_.get(index);
}
public static final int END_CURSOR_FIELD_NUMBER = 4;
private com.google.protobuf.ByteString endCursor_ = com.google.protobuf.ByteString.EMPTY;
/**
*
*
*
* A cursor that points to the position after the last result in the batch.
*
*
* bytes end_cursor = 4;
*
* @return The endCursor.
*/
@java.lang.Override
public com.google.protobuf.ByteString getEndCursor() {
return endCursor_;
}
public static final int MORE_RESULTS_FIELD_NUMBER = 5;
private int moreResults_ = 0;
/**
*
*
*
* The state of the query after the current batch.
*
*
* .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 5;
*
* @return The enum numeric value on the wire for moreResults.
*/
@java.lang.Override
public int getMoreResultsValue() {
return moreResults_;
}
/**
*
*
*
* The state of the query after the current batch.
*
*
* .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 5;
*
* @return The moreResults.
*/
@java.lang.Override
public com.google.datastore.v1.QueryResultBatch.MoreResultsType getMoreResults() {
com.google.datastore.v1.QueryResultBatch.MoreResultsType result =
com.google.datastore.v1.QueryResultBatch.MoreResultsType.forNumber(moreResults_);
return result == null
? com.google.datastore.v1.QueryResultBatch.MoreResultsType.UNRECOGNIZED
: result;
}
public static final int SNAPSHOT_VERSION_FIELD_NUMBER = 7;
private long snapshotVersion_ = 0L;
/**
*
*
*
* The version number of the snapshot this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater snapshot version number. Each batch's snapshot version
* is valid for all preceding batches.
* The value will be zero for eventually consistent queries.
*
*
* int64 snapshot_version = 7;
*
* @return The snapshotVersion.
*/
@java.lang.Override
public long getSnapshotVersion() {
return snapshotVersion_;
}
public static final int READ_TIME_FIELD_NUMBER = 8;
private com.google.protobuf.Timestamp readTime_;
/**
*
*
*
* Read timestamp this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater timestamp. Each batch's read timestamp
* is valid for all preceding batches.
* This value will not be set for eventually consistent queries in Cloud
* Datastore.
*
*
* .google.protobuf.Timestamp read_time = 8;
*
* @return Whether the readTime field is set.
*/
@java.lang.Override
public boolean hasReadTime() {
return readTime_ != null;
}
/**
*
*
*
* Read timestamp this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater timestamp. Each batch's read timestamp
* is valid for all preceding batches.
* This value will not be set for eventually consistent queries in Cloud
* Datastore.
*
*
* .google.protobuf.Timestamp read_time = 8;
*
* @return The readTime.
*/
@java.lang.Override
public com.google.protobuf.Timestamp getReadTime() {
return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
}
/**
*
*
*
* Read timestamp this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater timestamp. Each batch's read timestamp
* is valid for all preceding batches.
* This value will not be set for eventually consistent queries in Cloud
* Datastore.
*
*
* .google.protobuf.Timestamp read_time = 8;
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() {
return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (entityResultType_
!= com.google.datastore.v1.EntityResult.ResultType.RESULT_TYPE_UNSPECIFIED.getNumber()) {
output.writeEnum(1, entityResultType_);
}
for (int i = 0; i < entityResults_.size(); i++) {
output.writeMessage(2, entityResults_.get(i));
}
if (!skippedCursor_.isEmpty()) {
output.writeBytes(3, skippedCursor_);
}
if (!endCursor_.isEmpty()) {
output.writeBytes(4, endCursor_);
}
if (moreResults_
!= com.google.datastore.v1.QueryResultBatch.MoreResultsType.MORE_RESULTS_TYPE_UNSPECIFIED
.getNumber()) {
output.writeEnum(5, moreResults_);
}
if (skippedResults_ != 0) {
output.writeInt32(6, skippedResults_);
}
if (snapshotVersion_ != 0L) {
output.writeInt64(7, snapshotVersion_);
}
if (readTime_ != null) {
output.writeMessage(8, getReadTime());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (entityResultType_
!= com.google.datastore.v1.EntityResult.ResultType.RESULT_TYPE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, entityResultType_);
}
for (int i = 0; i < entityResults_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, entityResults_.get(i));
}
if (!skippedCursor_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, skippedCursor_);
}
if (!endCursor_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, endCursor_);
}
if (moreResults_
!= com.google.datastore.v1.QueryResultBatch.MoreResultsType.MORE_RESULTS_TYPE_UNSPECIFIED
.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, moreResults_);
}
if (skippedResults_ != 0) {
size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, skippedResults_);
}
if (snapshotVersion_ != 0L) {
size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, snapshotVersion_);
}
if (readTime_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getReadTime());
}
size += getUnknownFields().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.datastore.v1.QueryResultBatch)) {
return super.equals(obj);
}
com.google.datastore.v1.QueryResultBatch other = (com.google.datastore.v1.QueryResultBatch) obj;
if (getSkippedResults() != other.getSkippedResults()) return false;
if (!getSkippedCursor().equals(other.getSkippedCursor())) return false;
if (entityResultType_ != other.entityResultType_) return false;
if (!getEntityResultsList().equals(other.getEntityResultsList())) return false;
if (!getEndCursor().equals(other.getEndCursor())) return false;
if (moreResults_ != other.moreResults_) return false;
if (getSnapshotVersion() != other.getSnapshotVersion()) return false;
if (hasReadTime() != other.hasReadTime()) return false;
if (hasReadTime()) {
if (!getReadTime().equals(other.getReadTime())) return false;
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + SKIPPED_RESULTS_FIELD_NUMBER;
hash = (53 * hash) + getSkippedResults();
hash = (37 * hash) + SKIPPED_CURSOR_FIELD_NUMBER;
hash = (53 * hash) + getSkippedCursor().hashCode();
hash = (37 * hash) + ENTITY_RESULT_TYPE_FIELD_NUMBER;
hash = (53 * hash) + entityResultType_;
if (getEntityResultsCount() > 0) {
hash = (37 * hash) + ENTITY_RESULTS_FIELD_NUMBER;
hash = (53 * hash) + getEntityResultsList().hashCode();
}
hash = (37 * hash) + END_CURSOR_FIELD_NUMBER;
hash = (53 * hash) + getEndCursor().hashCode();
hash = (37 * hash) + MORE_RESULTS_FIELD_NUMBER;
hash = (53 * hash) + moreResults_;
hash = (37 * hash) + SNAPSHOT_VERSION_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSnapshotVersion());
if (hasReadTime()) {
hash = (37 * hash) + READ_TIME_FIELD_NUMBER;
hash = (53 * hash) + getReadTime().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.datastore.v1.QueryResultBatch parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.datastore.v1.QueryResultBatch parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.datastore.v1.QueryResultBatch parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.datastore.v1.QueryResultBatch 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.datastore.v1.QueryResultBatch parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.datastore.v1.QueryResultBatch parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.datastore.v1.QueryResultBatch parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.datastore.v1.QueryResultBatch 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.datastore.v1.QueryResultBatch parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.datastore.v1.QueryResultBatch 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.datastore.v1.QueryResultBatch parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.datastore.v1.QueryResultBatch parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.datastore.v1.QueryResultBatch prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
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 batch of results produced by a query.
*
*
* Protobuf type {@code google.datastore.v1.QueryResultBatch}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.datastore.v1.QueryResultBatch)
com.google.datastore.v1.QueryResultBatchOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.datastore.v1.QueryProto
.internal_static_google_datastore_v1_QueryResultBatch_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.datastore.v1.QueryProto
.internal_static_google_datastore_v1_QueryResultBatch_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.datastore.v1.QueryResultBatch.class,
com.google.datastore.v1.QueryResultBatch.Builder.class);
}
// Construct using com.google.datastore.v1.QueryResultBatch.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
skippedResults_ = 0;
skippedCursor_ = com.google.protobuf.ByteString.EMPTY;
entityResultType_ = 0;
if (entityResultsBuilder_ == null) {
entityResults_ = java.util.Collections.emptyList();
} else {
entityResults_ = null;
entityResultsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000008);
endCursor_ = com.google.protobuf.ByteString.EMPTY;
moreResults_ = 0;
snapshotVersion_ = 0L;
readTime_ = null;
if (readTimeBuilder_ != null) {
readTimeBuilder_.dispose();
readTimeBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.datastore.v1.QueryProto
.internal_static_google_datastore_v1_QueryResultBatch_descriptor;
}
@java.lang.Override
public com.google.datastore.v1.QueryResultBatch getDefaultInstanceForType() {
return com.google.datastore.v1.QueryResultBatch.getDefaultInstance();
}
@java.lang.Override
public com.google.datastore.v1.QueryResultBatch build() {
com.google.datastore.v1.QueryResultBatch result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.datastore.v1.QueryResultBatch buildPartial() {
com.google.datastore.v1.QueryResultBatch result =
new com.google.datastore.v1.QueryResultBatch(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(com.google.datastore.v1.QueryResultBatch result) {
if (entityResultsBuilder_ == null) {
if (((bitField0_ & 0x00000008) != 0)) {
entityResults_ = java.util.Collections.unmodifiableList(entityResults_);
bitField0_ = (bitField0_ & ~0x00000008);
}
result.entityResults_ = entityResults_;
} else {
result.entityResults_ = entityResultsBuilder_.build();
}
}
private void buildPartial0(com.google.datastore.v1.QueryResultBatch result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.skippedResults_ = skippedResults_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.skippedCursor_ = skippedCursor_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.entityResultType_ = entityResultType_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.endCursor_ = endCursor_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.moreResults_ = moreResults_;
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.snapshotVersion_ = snapshotVersion_;
}
if (((from_bitField0_ & 0x00000080) != 0)) {
result.readTime_ = readTimeBuilder_ == null ? readTime_ : readTimeBuilder_.build();
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.datastore.v1.QueryResultBatch) {
return mergeFrom((com.google.datastore.v1.QueryResultBatch) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.datastore.v1.QueryResultBatch other) {
if (other == com.google.datastore.v1.QueryResultBatch.getDefaultInstance()) return this;
if (other.getSkippedResults() != 0) {
setSkippedResults(other.getSkippedResults());
}
if (other.getSkippedCursor() != com.google.protobuf.ByteString.EMPTY) {
setSkippedCursor(other.getSkippedCursor());
}
if (other.entityResultType_ != 0) {
setEntityResultTypeValue(other.getEntityResultTypeValue());
}
if (entityResultsBuilder_ == null) {
if (!other.entityResults_.isEmpty()) {
if (entityResults_.isEmpty()) {
entityResults_ = other.entityResults_;
bitField0_ = (bitField0_ & ~0x00000008);
} else {
ensureEntityResultsIsMutable();
entityResults_.addAll(other.entityResults_);
}
onChanged();
}
} else {
if (!other.entityResults_.isEmpty()) {
if (entityResultsBuilder_.isEmpty()) {
entityResultsBuilder_.dispose();
entityResultsBuilder_ = null;
entityResults_ = other.entityResults_;
bitField0_ = (bitField0_ & ~0x00000008);
entityResultsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getEntityResultsFieldBuilder()
: null;
} else {
entityResultsBuilder_.addAllMessages(other.entityResults_);
}
}
}
if (other.getEndCursor() != com.google.protobuf.ByteString.EMPTY) {
setEndCursor(other.getEndCursor());
}
if (other.moreResults_ != 0) {
setMoreResultsValue(other.getMoreResultsValue());
}
if (other.getSnapshotVersion() != 0L) {
setSnapshotVersion(other.getSnapshotVersion());
}
if (other.hasReadTime()) {
mergeReadTime(other.getReadTime());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8:
{
entityResultType_ = input.readEnum();
bitField0_ |= 0x00000004;
break;
} // case 8
case 18:
{
com.google.datastore.v1.EntityResult m =
input.readMessage(
com.google.datastore.v1.EntityResult.parser(), extensionRegistry);
if (entityResultsBuilder_ == null) {
ensureEntityResultsIsMutable();
entityResults_.add(m);
} else {
entityResultsBuilder_.addMessage(m);
}
break;
} // case 18
case 26:
{
skippedCursor_ = input.readBytes();
bitField0_ |= 0x00000002;
break;
} // case 26
case 34:
{
endCursor_ = input.readBytes();
bitField0_ |= 0x00000010;
break;
} // case 34
case 40:
{
moreResults_ = input.readEnum();
bitField0_ |= 0x00000020;
break;
} // case 40
case 48:
{
skippedResults_ = input.readInt32();
bitField0_ |= 0x00000001;
break;
} // case 48
case 56:
{
snapshotVersion_ = input.readInt64();
bitField0_ |= 0x00000040;
break;
} // case 56
case 66:
{
input.readMessage(getReadTimeFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000080;
break;
} // case 66
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private int skippedResults_;
/**
*
*
*
* The number of results skipped, typically because of an offset.
*
*
* int32 skipped_results = 6;
*
* @return The skippedResults.
*/
@java.lang.Override
public int getSkippedResults() {
return skippedResults_;
}
/**
*
*
*
* The number of results skipped, typically because of an offset.
*
*
* int32 skipped_results = 6;
*
* @param value The skippedResults to set.
* @return This builder for chaining.
*/
public Builder setSkippedResults(int value) {
skippedResults_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* The number of results skipped, typically because of an offset.
*
*
* int32 skipped_results = 6;
*
* @return This builder for chaining.
*/
public Builder clearSkippedResults() {
bitField0_ = (bitField0_ & ~0x00000001);
skippedResults_ = 0;
onChanged();
return this;
}
private com.google.protobuf.ByteString skippedCursor_ = com.google.protobuf.ByteString.EMPTY;
/**
*
*
*
* A cursor that points to the position after the last skipped result.
* Will be set when `skipped_results` != 0.
*
*
* bytes skipped_cursor = 3;
*
* @return The skippedCursor.
*/
@java.lang.Override
public com.google.protobuf.ByteString getSkippedCursor() {
return skippedCursor_;
}
/**
*
*
*
* A cursor that points to the position after the last skipped result.
* Will be set when `skipped_results` != 0.
*
*
* bytes skipped_cursor = 3;
*
* @param value The skippedCursor to set.
* @return This builder for chaining.
*/
public Builder setSkippedCursor(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
skippedCursor_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* A cursor that points to the position after the last skipped result.
* Will be set when `skipped_results` != 0.
*
*
* bytes skipped_cursor = 3;
*
* @return This builder for chaining.
*/
public Builder clearSkippedCursor() {
bitField0_ = (bitField0_ & ~0x00000002);
skippedCursor_ = getDefaultInstance().getSkippedCursor();
onChanged();
return this;
}
private int entityResultType_ = 0;
/**
*
*
*
* The result type for every entity in `entity_results`.
*
*
* .google.datastore.v1.EntityResult.ResultType entity_result_type = 1;
*
* @return The enum numeric value on the wire for entityResultType.
*/
@java.lang.Override
public int getEntityResultTypeValue() {
return entityResultType_;
}
/**
*
*
*
* The result type for every entity in `entity_results`.
*
*
* .google.datastore.v1.EntityResult.ResultType entity_result_type = 1;
*
* @param value The enum numeric value on the wire for entityResultType to set.
* @return This builder for chaining.
*/
public Builder setEntityResultTypeValue(int value) {
entityResultType_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* The result type for every entity in `entity_results`.
*
*
* .google.datastore.v1.EntityResult.ResultType entity_result_type = 1;
*
* @return The entityResultType.
*/
@java.lang.Override
public com.google.datastore.v1.EntityResult.ResultType getEntityResultType() {
com.google.datastore.v1.EntityResult.ResultType result =
com.google.datastore.v1.EntityResult.ResultType.forNumber(entityResultType_);
return result == null ? com.google.datastore.v1.EntityResult.ResultType.UNRECOGNIZED : result;
}
/**
*
*
*
* The result type for every entity in `entity_results`.
*
*
* .google.datastore.v1.EntityResult.ResultType entity_result_type = 1;
*
* @param value The entityResultType to set.
* @return This builder for chaining.
*/
public Builder setEntityResultType(com.google.datastore.v1.EntityResult.ResultType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
entityResultType_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
*
* The result type for every entity in `entity_results`.
*
*
* .google.datastore.v1.EntityResult.ResultType entity_result_type = 1;
*
* @return This builder for chaining.
*/
public Builder clearEntityResultType() {
bitField0_ = (bitField0_ & ~0x00000004);
entityResultType_ = 0;
onChanged();
return this;
}
private java.util.List entityResults_ =
java.util.Collections.emptyList();
private void ensureEntityResultsIsMutable() {
if (!((bitField0_ & 0x00000008) != 0)) {
entityResults_ =
new java.util.ArrayList(entityResults_);
bitField0_ |= 0x00000008;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.datastore.v1.EntityResult,
com.google.datastore.v1.EntityResult.Builder,
com.google.datastore.v1.EntityResultOrBuilder>
entityResultsBuilder_;
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public java.util.List getEntityResultsList() {
if (entityResultsBuilder_ == null) {
return java.util.Collections.unmodifiableList(entityResults_);
} else {
return entityResultsBuilder_.getMessageList();
}
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public int getEntityResultsCount() {
if (entityResultsBuilder_ == null) {
return entityResults_.size();
} else {
return entityResultsBuilder_.getCount();
}
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public com.google.datastore.v1.EntityResult getEntityResults(int index) {
if (entityResultsBuilder_ == null) {
return entityResults_.get(index);
} else {
return entityResultsBuilder_.getMessage(index);
}
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public Builder setEntityResults(int index, com.google.datastore.v1.EntityResult value) {
if (entityResultsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureEntityResultsIsMutable();
entityResults_.set(index, value);
onChanged();
} else {
entityResultsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public Builder setEntityResults(
int index, com.google.datastore.v1.EntityResult.Builder builderForValue) {
if (entityResultsBuilder_ == null) {
ensureEntityResultsIsMutable();
entityResults_.set(index, builderForValue.build());
onChanged();
} else {
entityResultsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public Builder addEntityResults(com.google.datastore.v1.EntityResult value) {
if (entityResultsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureEntityResultsIsMutable();
entityResults_.add(value);
onChanged();
} else {
entityResultsBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public Builder addEntityResults(int index, com.google.datastore.v1.EntityResult value) {
if (entityResultsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureEntityResultsIsMutable();
entityResults_.add(index, value);
onChanged();
} else {
entityResultsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public Builder addEntityResults(com.google.datastore.v1.EntityResult.Builder builderForValue) {
if (entityResultsBuilder_ == null) {
ensureEntityResultsIsMutable();
entityResults_.add(builderForValue.build());
onChanged();
} else {
entityResultsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public Builder addEntityResults(
int index, com.google.datastore.v1.EntityResult.Builder builderForValue) {
if (entityResultsBuilder_ == null) {
ensureEntityResultsIsMutable();
entityResults_.add(index, builderForValue.build());
onChanged();
} else {
entityResultsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public Builder addAllEntityResults(
java.lang.Iterable extends com.google.datastore.v1.EntityResult> values) {
if (entityResultsBuilder_ == null) {
ensureEntityResultsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entityResults_);
onChanged();
} else {
entityResultsBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public Builder clearEntityResults() {
if (entityResultsBuilder_ == null) {
entityResults_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
} else {
entityResultsBuilder_.clear();
}
return this;
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public Builder removeEntityResults(int index) {
if (entityResultsBuilder_ == null) {
ensureEntityResultsIsMutable();
entityResults_.remove(index);
onChanged();
} else {
entityResultsBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public com.google.datastore.v1.EntityResult.Builder getEntityResultsBuilder(int index) {
return getEntityResultsFieldBuilder().getBuilder(index);
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public com.google.datastore.v1.EntityResultOrBuilder getEntityResultsOrBuilder(int index) {
if (entityResultsBuilder_ == null) {
return entityResults_.get(index);
} else {
return entityResultsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public java.util.List extends com.google.datastore.v1.EntityResultOrBuilder>
getEntityResultsOrBuilderList() {
if (entityResultsBuilder_ != null) {
return entityResultsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(entityResults_);
}
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public com.google.datastore.v1.EntityResult.Builder addEntityResultsBuilder() {
return getEntityResultsFieldBuilder()
.addBuilder(com.google.datastore.v1.EntityResult.getDefaultInstance());
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public com.google.datastore.v1.EntityResult.Builder addEntityResultsBuilder(int index) {
return getEntityResultsFieldBuilder()
.addBuilder(index, com.google.datastore.v1.EntityResult.getDefaultInstance());
}
/**
*
*
*
* The results for this batch.
*
*
* repeated .google.datastore.v1.EntityResult entity_results = 2;
*/
public java.util.List
getEntityResultsBuilderList() {
return getEntityResultsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.datastore.v1.EntityResult,
com.google.datastore.v1.EntityResult.Builder,
com.google.datastore.v1.EntityResultOrBuilder>
getEntityResultsFieldBuilder() {
if (entityResultsBuilder_ == null) {
entityResultsBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.datastore.v1.EntityResult,
com.google.datastore.v1.EntityResult.Builder,
com.google.datastore.v1.EntityResultOrBuilder>(
entityResults_,
((bitField0_ & 0x00000008) != 0),
getParentForChildren(),
isClean());
entityResults_ = null;
}
return entityResultsBuilder_;
}
private com.google.protobuf.ByteString endCursor_ = com.google.protobuf.ByteString.EMPTY;
/**
*
*
*
* A cursor that points to the position after the last result in the batch.
*
*
* bytes end_cursor = 4;
*
* @return The endCursor.
*/
@java.lang.Override
public com.google.protobuf.ByteString getEndCursor() {
return endCursor_;
}
/**
*
*
*
* A cursor that points to the position after the last result in the batch.
*
*
* bytes end_cursor = 4;
*
* @param value The endCursor to set.
* @return This builder for chaining.
*/
public Builder setEndCursor(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
endCursor_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* A cursor that points to the position after the last result in the batch.
*
*
* bytes end_cursor = 4;
*
* @return This builder for chaining.
*/
public Builder clearEndCursor() {
bitField0_ = (bitField0_ & ~0x00000010);
endCursor_ = getDefaultInstance().getEndCursor();
onChanged();
return this;
}
private int moreResults_ = 0;
/**
*
*
*
* The state of the query after the current batch.
*
*
* .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 5;
*
* @return The enum numeric value on the wire for moreResults.
*/
@java.lang.Override
public int getMoreResultsValue() {
return moreResults_;
}
/**
*
*
*
* The state of the query after the current batch.
*
*
* .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 5;
*
* @param value The enum numeric value on the wire for moreResults to set.
* @return This builder for chaining.
*/
public Builder setMoreResultsValue(int value) {
moreResults_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
*
* The state of the query after the current batch.
*
*
* .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 5;
*
* @return The moreResults.
*/
@java.lang.Override
public com.google.datastore.v1.QueryResultBatch.MoreResultsType getMoreResults() {
com.google.datastore.v1.QueryResultBatch.MoreResultsType result =
com.google.datastore.v1.QueryResultBatch.MoreResultsType.forNumber(moreResults_);
return result == null
? com.google.datastore.v1.QueryResultBatch.MoreResultsType.UNRECOGNIZED
: result;
}
/**
*
*
*
* The state of the query after the current batch.
*
*
* .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 5;
*
* @param value The moreResults to set.
* @return This builder for chaining.
*/
public Builder setMoreResults(com.google.datastore.v1.QueryResultBatch.MoreResultsType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
moreResults_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
*
* The state of the query after the current batch.
*
*
* .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 5;
*
* @return This builder for chaining.
*/
public Builder clearMoreResults() {
bitField0_ = (bitField0_ & ~0x00000020);
moreResults_ = 0;
onChanged();
return this;
}
private long snapshotVersion_;
/**
*
*
*
* The version number of the snapshot this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater snapshot version number. Each batch's snapshot version
* is valid for all preceding batches.
* The value will be zero for eventually consistent queries.
*
*
* int64 snapshot_version = 7;
*
* @return The snapshotVersion.
*/
@java.lang.Override
public long getSnapshotVersion() {
return snapshotVersion_;
}
/**
*
*
*
* The version number of the snapshot this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater snapshot version number. Each batch's snapshot version
* is valid for all preceding batches.
* The value will be zero for eventually consistent queries.
*
*
* int64 snapshot_version = 7;
*
* @param value The snapshotVersion to set.
* @return This builder for chaining.
*/
public Builder setSnapshotVersion(long value) {
snapshotVersion_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
*
* The version number of the snapshot this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater snapshot version number. Each batch's snapshot version
* is valid for all preceding batches.
* The value will be zero for eventually consistent queries.
*
*
* int64 snapshot_version = 7;
*
* @return This builder for chaining.
*/
public Builder clearSnapshotVersion() {
bitField0_ = (bitField0_ & ~0x00000040);
snapshotVersion_ = 0L;
onChanged();
return this;
}
private com.google.protobuf.Timestamp readTime_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
readTimeBuilder_;
/**
*
*
*
* Read timestamp this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater timestamp. Each batch's read timestamp
* is valid for all preceding batches.
* This value will not be set for eventually consistent queries in Cloud
* Datastore.
*
*
* .google.protobuf.Timestamp read_time = 8;
*
* @return Whether the readTime field is set.
*/
public boolean hasReadTime() {
return ((bitField0_ & 0x00000080) != 0);
}
/**
*
*
*
* Read timestamp this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater timestamp. Each batch's read timestamp
* is valid for all preceding batches.
* This value will not be set for eventually consistent queries in Cloud
* Datastore.
*
*
* .google.protobuf.Timestamp read_time = 8;
*
* @return The readTime.
*/
public com.google.protobuf.Timestamp getReadTime() {
if (readTimeBuilder_ == null) {
return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
} else {
return readTimeBuilder_.getMessage();
}
}
/**
*
*
*
* Read timestamp this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater timestamp. Each batch's read timestamp
* is valid for all preceding batches.
* This value will not be set for eventually consistent queries in Cloud
* Datastore.
*
*
* .google.protobuf.Timestamp read_time = 8;
*/
public Builder setReadTime(com.google.protobuf.Timestamp value) {
if (readTimeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
readTime_ = value;
} else {
readTimeBuilder_.setMessage(value);
}
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
*
*
*
* Read timestamp this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater timestamp. Each batch's read timestamp
* is valid for all preceding batches.
* This value will not be set for eventually consistent queries in Cloud
* Datastore.
*
*
* .google.protobuf.Timestamp read_time = 8;
*/
public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) {
if (readTimeBuilder_ == null) {
readTime_ = builderForValue.build();
} else {
readTimeBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
*
*
*
* Read timestamp this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater timestamp. Each batch's read timestamp
* is valid for all preceding batches.
* This value will not be set for eventually consistent queries in Cloud
* Datastore.
*
*
* .google.protobuf.Timestamp read_time = 8;
*/
public Builder mergeReadTime(com.google.protobuf.Timestamp value) {
if (readTimeBuilder_ == null) {
if (((bitField0_ & 0x00000080) != 0)
&& readTime_ != null
&& readTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
getReadTimeBuilder().mergeFrom(value);
} else {
readTime_ = value;
}
} else {
readTimeBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
*
*
*
* Read timestamp this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater timestamp. Each batch's read timestamp
* is valid for all preceding batches.
* This value will not be set for eventually consistent queries in Cloud
* Datastore.
*
*
* .google.protobuf.Timestamp read_time = 8;
*/
public Builder clearReadTime() {
bitField0_ = (bitField0_ & ~0x00000080);
readTime_ = null;
if (readTimeBuilder_ != null) {
readTimeBuilder_.dispose();
readTimeBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* Read timestamp this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater timestamp. Each batch's read timestamp
* is valid for all preceding batches.
* This value will not be set for eventually consistent queries in Cloud
* Datastore.
*
*
* .google.protobuf.Timestamp read_time = 8;
*/
public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() {
bitField0_ |= 0x00000080;
onChanged();
return getReadTimeFieldBuilder().getBuilder();
}
/**
*
*
*
* Read timestamp this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater timestamp. Each batch's read timestamp
* is valid for all preceding batches.
* This value will not be set for eventually consistent queries in Cloud
* Datastore.
*
*
* .google.protobuf.Timestamp read_time = 8;
*/
public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() {
if (readTimeBuilder_ != null) {
return readTimeBuilder_.getMessageOrBuilder();
} else {
return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
}
}
/**
*
*
*
* Read timestamp this batch was returned from.
* This applies to the range of results from the query's `start_cursor` (or
* the beginning of the query if no cursor was given) to this batch's
* `end_cursor` (not the query's `end_cursor`).
*
* In a single transaction, subsequent query result batches for the same query
* can have a greater timestamp. Each batch's read timestamp
* is valid for all preceding batches.
* This value will not be set for eventually consistent queries in Cloud
* Datastore.
*
*
* .google.protobuf.Timestamp read_time = 8;
*/
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_;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.datastore.v1.QueryResultBatch)
}
// @@protoc_insertion_point(class_scope:google.datastore.v1.QueryResultBatch)
private static final com.google.datastore.v1.QueryResultBatch DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.datastore.v1.QueryResultBatch();
}
public static com.google.datastore.v1.QueryResultBatch getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public QueryResultBatch parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.datastore.v1.QueryResultBatch getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy