@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.vision.v1.AddProductToProductSetRequest)) { return super.equals(obj); } com.google.cloud.vision.v1.AddProductToProductSetRequest other = (com.google.cloud.vision.v1.AddProductToProductSetRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && getProduct().equals(other.getProduct()); 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) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + PRODUCT_FIELD_NUMBER; hash = (53 * hash) + getProduct().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The resource name for the ProductSet to modify. * Format is: * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.cloud.vision.v1.AddProductToProductSetRequest other) { if (other == com.google.cloud.vision.v1.AddProductToProductSetRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (!other.getProduct().isEmpty()) { product_ = other.product_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Test @SuppressWarnings("all") public void addProductToProductSetTest() { Empty expectedResponse = Empty.newBuilder().build(); mockProductSearch.addResponse(expectedResponse); String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); String product = "product-309474065"; client.addProductToProductSet(formattedName, product); List<GeneratedMessageV3> actualRequests = mockProductSearch.getRequests(); Assert.assertEquals(1, actualRequests.size()); AddProductToProductSetRequest actualRequest = (AddProductToProductSetRequest) actualRequests.get(0); Assert.assertEquals(formattedName, actualRequest.getName()); Assert.assertEquals(product, actualRequest.getProduct()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.vision.v1.AddProductToProductSetRequest)) { return super.equals(obj); } com.google.cloud.vision.v1.AddProductToProductSetRequest other = (com.google.cloud.vision.v1.AddProductToProductSetRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && getProduct().equals(other.getProduct()); 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) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + PRODUCT_FIELD_NUMBER; hash = (53 * hash) + getProduct().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The resource name for the ProductSet to modify. * Format is: * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.cloud.vision.v1.AddProductToProductSetRequest other) { if (other == com.google.cloud.vision.v1.AddProductToProductSetRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (!other.getProduct().isEmpty()) { product_ = other.product_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }