001 002package com.commercetools.ml.models.image_search; 003 004import java.time.*; 005import java.util.*; 006 007import com.fasterxml.jackson.annotation.JsonCreator; 008import com.fasterxml.jackson.annotation.JsonProperty; 009import com.fasterxml.jackson.databind.annotation.*; 010 011import io.vrap.rmf.base.client.ModelBase; 012import io.vrap.rmf.base.client.utils.Generated; 013 014import org.apache.commons.lang3.builder.EqualsBuilder; 015import org.apache.commons.lang3.builder.HashCodeBuilder; 016 017/** 018 * <p>An image URL and the product variants it is contained in. If no matching images are found, ResultItem is not present.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class ResultItemImpl implements ResultItem, ModelBase { 022 023 private String imageUrl; 024 025 private java.util.List<com.commercetools.ml.models.common.ProductVariant> productVariants; 026 027 /** 028 * create instance with all properties 029 */ 030 @JsonCreator 031 ResultItemImpl(@JsonProperty("imageUrl") final String imageUrl, 032 @JsonProperty("productVariants") final java.util.List<com.commercetools.ml.models.common.ProductVariant> productVariants) { 033 this.imageUrl = imageUrl; 034 this.productVariants = productVariants; 035 } 036 037 /** 038 * create empty instance 039 */ 040 public ResultItemImpl() { 041 } 042 043 /** 044 * <p>The URL of the image.</p> 045 */ 046 047 public String getImageUrl() { 048 return this.imageUrl; 049 } 050 051 /** 052 * <p>An array of product variants containing the image URL.</p> 053 */ 054 055 public java.util.List<com.commercetools.ml.models.common.ProductVariant> getProductVariants() { 056 return this.productVariants; 057 } 058 059 public void setImageUrl(final String imageUrl) { 060 this.imageUrl = imageUrl; 061 } 062 063 public void setProductVariants(final com.commercetools.ml.models.common.ProductVariant... productVariants) { 064 this.productVariants = new ArrayList<>(Arrays.asList(productVariants)); 065 } 066 067 public void setProductVariants( 068 final java.util.List<com.commercetools.ml.models.common.ProductVariant> productVariants) { 069 this.productVariants = productVariants; 070 } 071 072 @Override 073 public boolean equals(Object o) { 074 if (this == o) 075 return true; 076 077 if (o == null || getClass() != o.getClass()) 078 return false; 079 080 ResultItemImpl that = (ResultItemImpl) o; 081 082 return new EqualsBuilder().append(imageUrl, that.imageUrl) 083 .append(productVariants, that.productVariants) 084 .isEquals(); 085 } 086 087 @Override 088 public int hashCode() { 089 return new HashCodeBuilder(17, 37).append(imageUrl).append(productVariants).toHashCode(); 090 } 091 092}