001 002package com.commercetools.ml.models.common; 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>The product variant that contains the image.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class ProductVariantImpl implements ProductVariant, ModelBase { 022 023 private com.commercetools.ml.models.common.ProductReference product; 024 025 private Boolean staged; 026 027 private Integer variantId; 028 029 @JsonCreator 030 ProductVariantImpl(@JsonProperty("product") final com.commercetools.ml.models.common.ProductReference product, 031 @JsonProperty("staged") final Boolean staged, @JsonProperty("variantId") final Integer variantId) { 032 this.product = product; 033 this.staged = staged; 034 this.variantId = variantId; 035 } 036 037 public ProductVariantImpl() { 038 } 039 040 /** 041 * <p>The product that contains this variant.</p> 042 */ 043 044 public com.commercetools.ml.models.common.ProductReference getProduct() { 045 return this.product; 046 } 047 048 /** 049 * <p>The state of the product variant.</p> 050 */ 051 052 public Boolean getStaged() { 053 return this.staged; 054 } 055 056 /** 057 * <p>The id of the product variant.</p> 058 */ 059 060 public Integer getVariantId() { 061 return this.variantId; 062 } 063 064 public void setProduct(final com.commercetools.ml.models.common.ProductReference product) { 065 this.product = product; 066 } 067 068 public void setStaged(final Boolean staged) { 069 this.staged = staged; 070 } 071 072 public void setVariantId(final Integer variantId) { 073 this.variantId = variantId; 074 } 075 076 @Override 077 public boolean equals(Object o) { 078 if (this == o) 079 return true; 080 081 if (o == null || getClass() != o.getClass()) 082 return false; 083 084 ProductVariantImpl that = (ProductVariantImpl) o; 085 086 return new EqualsBuilder().append(product, that.product) 087 .append(staged, that.staged) 088 .append(variantId, that.variantId) 089 .isEquals(); 090 } 091 092 @Override 093 public int hashCode() { 094 return new HashCodeBuilder(17, 37).append(product).append(staged).append(variantId).toHashCode(); 095 } 096 097}