All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.datastore.v1.ReadOptions Maven / Gradle / Ivy

The newest version!
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/datastore/v1/datastore.proto

package com.google.datastore.v1;

/**
 * 
 * The options shared by read requests.
 * 
* * Protobuf type {@code google.datastore.v1.ReadOptions} */ public final class ReadOptions extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.datastore.v1.ReadOptions) ReadOptionsOrBuilder { // Use ReadOptions.newBuilder() to construct. private ReadOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private ReadOptions() { } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } private ReadOptions( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); int mutable_bitField0_ = 0; try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!input.skipField(tag)) { done = true; } break; } case 8: { int rawValue = input.readEnum(); consistencyTypeCase_ = 1; consistencyType_ = rawValue; break; } case 18: { consistencyTypeCase_ = 2; consistencyType_ = input.readBytes(); 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 { makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.datastore.v1.DatastoreProto.internal_static_google_datastore_v1_ReadOptions_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.datastore.v1.DatastoreProto.internal_static_google_datastore_v1_ReadOptions_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.datastore.v1.ReadOptions.class, com.google.datastore.v1.ReadOptions.Builder.class); } /** *
   * The possible values for read consistencies.
   * 
* * Protobuf enum {@code google.datastore.v1.ReadOptions.ReadConsistency} */ public enum ReadConsistency implements com.google.protobuf.ProtocolMessageEnum { /** *
     * Unspecified. This value must not be used.
     * 
* * READ_CONSISTENCY_UNSPECIFIED = 0; */ READ_CONSISTENCY_UNSPECIFIED(0), /** *
     * Strong consistency.
     * 
* * STRONG = 1; */ STRONG(1), /** *
     * Eventual consistency.
     * 
* * EVENTUAL = 2; */ EVENTUAL(2), UNRECOGNIZED(-1), ; /** *
     * Unspecified. This value must not be used.
     * 
* * READ_CONSISTENCY_UNSPECIFIED = 0; */ public static final int READ_CONSISTENCY_UNSPECIFIED_VALUE = 0; /** *
     * Strong consistency.
     * 
* * STRONG = 1; */ public static final int STRONG_VALUE = 1; /** *
     * Eventual consistency.
     * 
* * EVENTUAL = 2; */ public static final int EVENTUAL_VALUE = 2; 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 ReadConsistency valueOf(int value) { return forNumber(value); } public static ReadConsistency forNumber(int value) { switch (value) { case 0: return READ_CONSISTENCY_UNSPECIFIED; case 1: return STRONG; case 2: return EVENTUAL; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< ReadConsistency> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { public ReadConsistency findValueByNumber(int number) { return ReadConsistency.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.datastore.v1.ReadOptions.getDescriptor().getEnumTypes().get(0); } private static final ReadConsistency[] VALUES = values(); public static ReadConsistency 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 ReadConsistency(int value) { this.value = value; } // @@protoc_insertion_point(enum_scope:google.datastore.v1.ReadOptions.ReadConsistency) } private int consistencyTypeCase_ = 0; private java.lang.Object consistencyType_; public enum ConsistencyTypeCase implements com.google.protobuf.Internal.EnumLite { READ_CONSISTENCY(1), TRANSACTION(2), CONSISTENCYTYPE_NOT_SET(0); private final int value; private ConsistencyTypeCase(int value) { this.value = value; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static ConsistencyTypeCase valueOf(int value) { return forNumber(value); } public static ConsistencyTypeCase forNumber(int value) { switch (value) { case 1: return READ_CONSISTENCY; case 2: return TRANSACTION; case 0: return CONSISTENCYTYPE_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public ConsistencyTypeCase getConsistencyTypeCase() { return ConsistencyTypeCase.forNumber( consistencyTypeCase_); } public static final int READ_CONSISTENCY_FIELD_NUMBER = 1; /** *
   * The non-transactional read consistency to use.
   * Cannot be set to `STRONG` for global queries.
   * 
* * optional .google.datastore.v1.ReadOptions.ReadConsistency read_consistency = 1; */ public int getReadConsistencyValue() { if (consistencyTypeCase_ == 1) { return (java.lang.Integer) consistencyType_; } return 0; } /** *
   * The non-transactional read consistency to use.
   * Cannot be set to `STRONG` for global queries.
   * 
* * optional .google.datastore.v1.ReadOptions.ReadConsistency read_consistency = 1; */ public com.google.datastore.v1.ReadOptions.ReadConsistency getReadConsistency() { if (consistencyTypeCase_ == 1) { com.google.datastore.v1.ReadOptions.ReadConsistency result = com.google.datastore.v1.ReadOptions.ReadConsistency.valueOf( (java.lang.Integer) consistencyType_); return result == null ? com.google.datastore.v1.ReadOptions.ReadConsistency.UNRECOGNIZED : result; } return com.google.datastore.v1.ReadOptions.ReadConsistency.READ_CONSISTENCY_UNSPECIFIED; } public static final int TRANSACTION_FIELD_NUMBER = 2; /** *
   * The identifier of the transaction in which to read. A
   * transaction identifier is returned by a call to
   * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction].
   * 
* * optional bytes transaction = 2; */ public com.google.protobuf.ByteString getTransaction() { if (consistencyTypeCase_ == 2) { return (com.google.protobuf.ByteString) consistencyType_; } return com.google.protobuf.ByteString.EMPTY; } 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 (consistencyTypeCase_ == 1) { output.writeEnum(1, ((java.lang.Integer) consistencyType_)); } if (consistencyTypeCase_ == 2) { output.writeBytes( 2, (com.google.protobuf.ByteString)((com.google.protobuf.ByteString) consistencyType_)); } } public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (consistencyTypeCase_ == 1) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, ((java.lang.Integer) consistencyType_)); } if (consistencyTypeCase_ == 2) { size += com.google.protobuf.CodedOutputStream .computeBytesSize( 2, (com.google.protobuf.ByteString)((com.google.protobuf.ByteString) consistencyType_)); } memoizedSize = size; return size; } private static final long serialVersionUID = 0L; @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.datastore.v1.ReadOptions)) { return super.equals(obj); } com.google.datastore.v1.ReadOptions other = (com.google.datastore.v1.ReadOptions) obj; boolean result = true; result = result && getConsistencyTypeCase().equals( other.getConsistencyTypeCase()); if (!result) return false; switch (consistencyTypeCase_) { case 1: result = result && getReadConsistencyValue() == other.getReadConsistencyValue(); break; case 2: result = result && getTransaction() .equals(other.getTransaction()); break; case 0: default: } return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); switch (consistencyTypeCase_) { case 1: hash = (37 * hash) + READ_CONSISTENCY_FIELD_NUMBER; hash = (53 * hash) + getReadConsistencyValue(); break; case 2: hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; hash = (53 * hash) + getTransaction().hashCode(); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.datastore.v1.ReadOptions parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.datastore.v1.ReadOptions 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.ReadOptions parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.datastore.v1.ReadOptions parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.datastore.v1.ReadOptions parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.datastore.v1.ReadOptions 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.ReadOptions parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.google.datastore.v1.ReadOptions 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.ReadOptions parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.datastore.v1.ReadOptions 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.datastore.v1.ReadOptions 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; } /** *
   * The options shared by read requests.
   * 
* * Protobuf type {@code google.datastore.v1.ReadOptions} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.datastore.v1.ReadOptions) com.google.datastore.v1.ReadOptionsOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.datastore.v1.DatastoreProto.internal_static_google_datastore_v1_ReadOptions_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.datastore.v1.DatastoreProto.internal_static_google_datastore_v1_ReadOptions_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.datastore.v1.ReadOptions.class, com.google.datastore.v1.ReadOptions.Builder.class); } // Construct using com.google.datastore.v1.ReadOptions.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(); consistencyTypeCase_ = 0; consistencyType_ = null; return this; } public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.datastore.v1.DatastoreProto.internal_static_google_datastore_v1_ReadOptions_descriptor; } public com.google.datastore.v1.ReadOptions getDefaultInstanceForType() { return com.google.datastore.v1.ReadOptions.getDefaultInstance(); } public com.google.datastore.v1.ReadOptions build() { com.google.datastore.v1.ReadOptions result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public com.google.datastore.v1.ReadOptions buildPartial() { com.google.datastore.v1.ReadOptions result = new com.google.datastore.v1.ReadOptions(this); if (consistencyTypeCase_ == 1) { result.consistencyType_ = consistencyType_; } if (consistencyTypeCase_ == 2) { result.consistencyType_ = consistencyType_; } result.consistencyTypeCase_ = consistencyTypeCase_; onBuilt(); return result; } public Builder clone() { return (Builder) super.clone(); } public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, 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, Object value) { return (Builder) super.setRepeatedField(field, index, value); } public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { return (Builder) super.addRepeatedField(field, value); } public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.datastore.v1.ReadOptions) { return mergeFrom((com.google.datastore.v1.ReadOptions)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.datastore.v1.ReadOptions other) { if (other == com.google.datastore.v1.ReadOptions.getDefaultInstance()) return this; switch (other.getConsistencyTypeCase()) { case READ_CONSISTENCY: { setReadConsistencyValue(other.getReadConsistencyValue()); break; } case TRANSACTION: { setTransaction(other.getTransaction()); break; } case CONSISTENCYTYPE_NOT_SET: { break; } } 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.datastore.v1.ReadOptions parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.datastore.v1.ReadOptions) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int consistencyTypeCase_ = 0; private java.lang.Object consistencyType_; public ConsistencyTypeCase getConsistencyTypeCase() { return ConsistencyTypeCase.forNumber( consistencyTypeCase_); } public Builder clearConsistencyType() { consistencyTypeCase_ = 0; consistencyType_ = null; onChanged(); return this; } /** *
     * The non-transactional read consistency to use.
     * Cannot be set to `STRONG` for global queries.
     * 
* * optional .google.datastore.v1.ReadOptions.ReadConsistency read_consistency = 1; */ public int getReadConsistencyValue() { if (consistencyTypeCase_ == 1) { return ((java.lang.Integer) consistencyType_).intValue(); } return 0; } /** *
     * The non-transactional read consistency to use.
     * Cannot be set to `STRONG` for global queries.
     * 
* * optional .google.datastore.v1.ReadOptions.ReadConsistency read_consistency = 1; */ public Builder setReadConsistencyValue(int value) { consistencyTypeCase_ = 1; consistencyType_ = value; onChanged(); return this; } /** *
     * The non-transactional read consistency to use.
     * Cannot be set to `STRONG` for global queries.
     * 
* * optional .google.datastore.v1.ReadOptions.ReadConsistency read_consistency = 1; */ public com.google.datastore.v1.ReadOptions.ReadConsistency getReadConsistency() { if (consistencyTypeCase_ == 1) { com.google.datastore.v1.ReadOptions.ReadConsistency result = com.google.datastore.v1.ReadOptions.ReadConsistency.valueOf( (java.lang.Integer) consistencyType_); return result == null ? com.google.datastore.v1.ReadOptions.ReadConsistency.UNRECOGNIZED : result; } return com.google.datastore.v1.ReadOptions.ReadConsistency.READ_CONSISTENCY_UNSPECIFIED; } /** *
     * The non-transactional read consistency to use.
     * Cannot be set to `STRONG` for global queries.
     * 
* * optional .google.datastore.v1.ReadOptions.ReadConsistency read_consistency = 1; */ public Builder setReadConsistency(com.google.datastore.v1.ReadOptions.ReadConsistency value) { if (value == null) { throw new NullPointerException(); } consistencyTypeCase_ = 1; consistencyType_ = value.getNumber(); onChanged(); return this; } /** *
     * The non-transactional read consistency to use.
     * Cannot be set to `STRONG` for global queries.
     * 
* * optional .google.datastore.v1.ReadOptions.ReadConsistency read_consistency = 1; */ public Builder clearReadConsistency() { if (consistencyTypeCase_ == 1) { consistencyTypeCase_ = 0; consistencyType_ = null; onChanged(); } return this; } /** *
     * The identifier of the transaction in which to read. A
     * transaction identifier is returned by a call to
     * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction].
     * 
* * optional bytes transaction = 2; */ public com.google.protobuf.ByteString getTransaction() { if (consistencyTypeCase_ == 2) { return (com.google.protobuf.ByteString) consistencyType_; } return com.google.protobuf.ByteString.EMPTY; } /** *
     * The identifier of the transaction in which to read. A
     * transaction identifier is returned by a call to
     * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction].
     * 
* * optional bytes transaction = 2; */ public Builder setTransaction(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } consistencyTypeCase_ = 2; consistencyType_ = value; onChanged(); return this; } /** *
     * The identifier of the transaction in which to read. A
     * transaction identifier is returned by a call to
     * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction].
     * 
* * optional bytes transaction = 2; */ public Builder clearTransaction() { if (consistencyTypeCase_ == 2) { consistencyTypeCase_ = 0; consistencyType_ = null; onChanged(); } return this; } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return this; } public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return this; } // @@protoc_insertion_point(builder_scope:google.datastore.v1.ReadOptions) } // @@protoc_insertion_point(class_scope:google.datastore.v1.ReadOptions) private static final com.google.datastore.v1.ReadOptions DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.datastore.v1.ReadOptions(); } public static com.google.datastore.v1.ReadOptions getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { public ReadOptions parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new ReadOptions(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.datastore.v1.ReadOptions getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy