/** * * * <pre> * The key of the row to which the conditional mutation should be applied. * </pre> * * <code>bytes row_key = 2;</code> */ public Builder clearRowKey() { rowKey_ = getDefaultInstance().getRowKey(); onChanged(); return this; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.v2.CheckAndMutateRowRequest)) { return super.equals(obj); } com.google.bigtable.v2.CheckAndMutateRowRequest other = (com.google.bigtable.v2.CheckAndMutateRowRequest) obj; boolean result = true; result = result && getTableName().equals(other.getTableName()); result = result && getAppProfileId().equals(other.getAppProfileId()); result = result && getRowKey().equals(other.getRowKey()); result = result && (hasPredicateFilter() == other.hasPredicateFilter()); if (hasPredicateFilter()) { result = result && getPredicateFilter().equals(other.getPredicateFilter()); } result = result && getTrueMutationsList().equals(other.getTrueMutationsList()); result = result && getFalseMutationsList().equals(other.getFalseMutationsList()); 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) + TABLE_NAME_FIELD_NUMBER; hash = (53 * hash) + getTableName().hashCode(); hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; hash = (53 * hash) + getAppProfileId().hashCode(); hash = (37 * hash) + ROW_KEY_FIELD_NUMBER; hash = (53 * hash) + getRowKey().hashCode(); if (hasPredicateFilter()) { hash = (37 * hash) + PREDICATE_FILTER_FIELD_NUMBER; hash = (53 * hash) + getPredicateFilter().hashCode(); } if (getTrueMutationsCount() > 0) { hash = (37 * hash) + TRUE_MUTATIONS_FIELD_NUMBER; hash = (53 * hash) + getTrueMutationsList().hashCode(); } if (getFalseMutationsCount() > 0) { hash = (37 * hash) + FALSE_MUTATIONS_FIELD_NUMBER; hash = (53 * hash) + getFalseMutationsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@Test @SuppressWarnings("all") public void checkAndMutateRowTest() { boolean predicateMatched = true; CheckAndMutateRowResponse expectedResponse = CheckAndMutateRowResponse.newBuilder().setPredicateMatched(predicateMatched).build(); mockBigtable.addResponse(expectedResponse); TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); ByteString rowKey = ByteString.copyFromUtf8("122"); RowFilter predicateFilter = RowFilter.newBuilder().build(); List<Mutation> trueMutations = new ArrayList<>(); List<Mutation> falseMutations = new ArrayList<>(); CheckAndMutateRowResponse actualResponse = client.checkAndMutateRow(tableName, rowKey, predicateFilter, trueMutations, falseMutations); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockBigtable.getRequests(); Assert.assertEquals(1, actualRequests.size()); CheckAndMutateRowRequest actualRequest = (CheckAndMutateRowRequest) actualRequests.get(0); Assert.assertEquals(tableName, TableName.parse(actualRequest.getTableName())); Assert.assertEquals(rowKey, actualRequest.getRowKey()); Assert.assertEquals(predicateFilter, actualRequest.getPredicateFilter()); Assert.assertEquals(trueMutations, actualRequest.getTrueMutationsList()); Assert.assertEquals(falseMutations, actualRequest.getFalseMutationsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
/** * <pre> * The key of the row to which the conditional mutation should be applied. * </pre> * * <code>bytes row_key = 2;</code> */ public Builder clearRowKey() { rowKey_ = getDefaultInstance().getRowKey(); onChanged(); return this; }
/** * * * <pre> * The key of the row to which the conditional mutation should be applied. * </pre> * * <code>bytes row_key = 2;</code> */ public Builder clearRowKey() { rowKey_ = getDefaultInstance().getRowKey(); onChanged(); return this; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.v2.CheckAndMutateRowRequest)) { return super.equals(obj); } com.google.bigtable.v2.CheckAndMutateRowRequest other = (com.google.bigtable.v2.CheckAndMutateRowRequest) obj; boolean result = true; result = result && getTableName().equals(other.getTableName()); result = result && getAppProfileId().equals(other.getAppProfileId()); result = result && getRowKey().equals(other.getRowKey()); result = result && (hasPredicateFilter() == other.hasPredicateFilter()); if (hasPredicateFilter()) { result = result && getPredicateFilter().equals(other.getPredicateFilter()); } result = result && getTrueMutationsList().equals(other.getTrueMutationsList()); result = result && getFalseMutationsList().equals(other.getFalseMutationsList()); 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) + TABLE_NAME_FIELD_NUMBER; hash = (53 * hash) + getTableName().hashCode(); hash = (37 * hash) + ROW_KEY_FIELD_NUMBER; hash = (53 * hash) + getRowKey().hashCode(); if (hasPredicateFilter()) { hash = (37 * hash) + PREDICATE_FILTER_FIELD_NUMBER; hash = (53 * hash) + getPredicateFilter().hashCode(); } if (getTrueMutationsCount() > 0) { hash = (37 * hash) + TRUE_MUTATIONS_FIELD_NUMBER; hash = (53 * hash) + getTrueMutationsList().hashCode(); } if (getFalseMutationsCount() > 0) { hash = (37 * hash) + FALSE_MUTATIONS_FIELD_NUMBER; hash = (53 * hash) + getFalseMutationsList().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.bigtable.v2.CheckAndMutateRowRequest)) { return super.equals(obj); } com.google.bigtable.v2.CheckAndMutateRowRequest other = (com.google.bigtable.v2.CheckAndMutateRowRequest) obj; boolean result = true; result = result && getTableName() .equals(other.getTableName()); result = result && getRowKey() .equals(other.getRowKey()); result = result && (hasPredicateFilter() == other.hasPredicateFilter()); if (hasPredicateFilter()) { result = result && getPredicateFilter() .equals(other.getPredicateFilter()); } result = result && getTrueMutationsList() .equals(other.getTrueMutationsList()); result = result && getFalseMutationsList() .equals(other.getFalseMutationsList()); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + TABLE_NAME_FIELD_NUMBER; hash = (53 * hash) + getTableName().hashCode(); hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; hash = (53 * hash) + getAppProfileId().hashCode(); hash = (37 * hash) + ROW_KEY_FIELD_NUMBER; hash = (53 * hash) + getRowKey().hashCode(); if (hasPredicateFilter()) { hash = (37 * hash) + PREDICATE_FILTER_FIELD_NUMBER; hash = (53 * hash) + getPredicateFilter().hashCode(); } if (getTrueMutationsCount() > 0) { hash = (37 * hash) + TRUE_MUTATIONS_FIELD_NUMBER; hash = (53 * hash) + getTrueMutationsList().hashCode(); } if (getFalseMutationsCount() > 0) { hash = (37 * hash) + FALSE_MUTATIONS_FIELD_NUMBER; hash = (53 * hash) + getFalseMutationsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }