@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
public Builder mergeFrom(com.google.datastore.v1.TransactionOptions other) { if (other == com.google.datastore.v1.TransactionOptions.getDefaultInstance()) return this; switch (other.getModeCase()) { case READ_WRITE: { mergeReadWrite(other.getReadWrite()); break; } case READ_ONLY: { mergeReadOnly(other.getReadOnly()); break; } case MODE_NOT_SET: { break; } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.datastore.v1.TransactionOptions)) { return super.equals(obj); } com.google.datastore.v1.TransactionOptions other = (com.google.datastore.v1.TransactionOptions) obj; boolean result = true; result = result && getModeCase().equals(other.getModeCase()); if (!result) return false; switch (modeCase_) { case 1: result = result && getReadWrite().equals(other.getReadWrite()); break; case 2: result = result && getReadOnly().equals(other.getReadOnly()); break; case 0: default: } 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(); switch (modeCase_) { case 1: hash = (37 * hash) + READ_WRITE_FIELD_NUMBER; hash = (53 * hash) + getReadWrite().hashCode(); break; case 2: hash = (37 * hash) + READ_ONLY_FIELD_NUMBER; hash = (53 * hash) + getReadOnly().hashCode(); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); switch (modeCase_) { case 1: hash = (37 * hash) + READ_WRITE_FIELD_NUMBER; hash = (53 * hash) + getReadWrite().hashCode(); break; case 2: hash = (37 * hash) + READ_ONLY_FIELD_NUMBER; hash = (53 * hash) + getReadOnly().hashCode(); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public com.google.datastore.v1.TransactionOptions getDefaultInstanceForType() { return com.google.datastore.v1.TransactionOptions.getDefaultInstance(); }
@Override public T call() throws DatastoreException { transaction = datastore.newTransaction(options); try { T value = callable.run(transaction); transaction.commit(); return value; } catch (Exception ex) { transaction.rollback(); throw DatastoreException.propagateUserException(ex); } finally { if (transaction.isActive()) { transaction.rollback(); } if (options != null && options.getModeCase().equals(TransactionOptions.ModeCase.READ_WRITE)) { setPrevTransactionId(transaction.getTransactionId()); } } } }
@java.lang.Override public com.google.datastore.v1.TransactionOptions build() { com.google.datastore.v1.TransactionOptions result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; hash = (53 * hash) + getProjectId().hashCode(); if (hasTransactionOptions()) { hash = (37 * hash) + TRANSACTION_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getTransactionOptions().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.datastore.v1.BeginTransactionRequest)) { return super.equals(obj); } com.google.datastore.v1.BeginTransactionRequest other = (com.google.datastore.v1.BeginTransactionRequest) obj; boolean result = true; result = result && getProjectId().equals(other.getProjectId()); result = result && (hasTransactionOptions() == other.hasTransactionOptions()); if (hasTransactionOptions()) { result = result && getTransactionOptions().equals(other.getTransactionOptions()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public com.google.datastore.v1.TransactionOptions buildPartial() { com.google.datastore.v1.TransactionOptions result = new com.google.datastore.v1.TransactionOptions(this); if (modeCase_ == 1) { if (readWriteBuilder_ == null) { result.mode_ = mode_; } else { result.mode_ = readWriteBuilder_.build(); } } if (modeCase_ == 2) { if (readOnlyBuilder_ == null) { result.mode_ = mode_; } else { result.mode_ = readOnlyBuilder_.build(); } } result.modeCase_ = modeCase_; onBuilt(); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.datastore.v1.TransactionOptions)) { return super.equals(obj); } com.google.datastore.v1.TransactionOptions other = (com.google.datastore.v1.TransactionOptions) obj; boolean result = true; result = result && getModeCase().equals( other.getModeCase()); if (!result) return false; switch (modeCase_) { case 1: result = result && getReadWrite() .equals(other.getReadWrite()); break; case 2: result = result && getReadOnly() .equals(other.getReadOnly()); break; case 0: default: } return result; }
public static Builder newBuilder(com.google.datastore.v1.TransactionOptions prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); switch (modeCase_) { case 1: hash = (37 * hash) + READ_WRITE_FIELD_NUMBER; hash = (53 * hash) + getReadWrite().hashCode(); break; case 2: hash = (37 * hash) + READ_ONLY_FIELD_NUMBER; hash = (53 * hash) + getReadOnly().hashCode(); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * Options for a new transaction. * </pre> * * <code>.google.datastore.v1.TransactionOptions transaction_options = 10;</code> */ public com.google.datastore.v1.TransactionOptions getTransactionOptions() { return transactionOptions_ == null ? com.google.datastore.v1.TransactionOptions.getDefaultInstance() : transactionOptions_; } /**
@Override public T call() throws DatastoreException { transaction = datastore.newTransaction(options); try { T value = callable.run(transaction); transaction.commit(); return value; } catch (Exception ex) { transaction.rollback(); throw DatastoreException.propagateUserException(ex); } finally { if (transaction.isActive()) { transaction.rollback(); } if (options != null && options.getModeCase().equals(TransactionOptions.ModeCase.READ_WRITE)) { setPrevTransactionId(transaction.getTransactionId()); } } } }
public com.google.datastore.v1.TransactionOptions build() { com.google.datastore.v1.TransactionOptions result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; hash = (53 * hash) + getProjectId().hashCode(); if (hasTransactionOptions()) { hash = (37 * hash) + TRANSACTION_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getTransactionOptions().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }