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 /** 030 * create instance with all properties 031 */ 032 @JsonCreator 033 ProductVariantImpl(@JsonProperty("product") final com.commercetools.ml.models.common.ProductReference product, 034 @JsonProperty("staged") final Boolean staged, @JsonProperty("variantId") final Integer variantId) { 035 this.product = product; 036 this.staged = staged; 037 this.variantId = variantId; 038 } 039 040 /** 041 * create empty instance 042 */ 043 public ProductVariantImpl() { 044 } 045 046 /** 047 * <p>The product that contains this variant.</p> 048 */ 049 050 public com.commercetools.ml.models.common.ProductReference getProduct() { 051 return this.product; 052 } 053 054 /** 055 * <p>The state of the product variant.</p> 056 */ 057 058 public Boolean getStaged() { 059 return this.staged; 060 } 061 062 /** 063 * <p>The id of the product variant.</p> 064 */ 065 066 public Integer getVariantId() { 067 return this.variantId; 068 } 069 070 public void setProduct(final com.commercetools.ml.models.common.ProductReference product) { 071 this.product = product; 072 } 073 074 public void setStaged(final Boolean staged) { 075 this.staged = staged; 076 } 077 078 public void setVariantId(final Integer variantId) { 079 this.variantId = variantId; 080 } 081 082 @Override 083 public boolean equals(Object o) { 084 if (this == o) 085 return true; 086 087 if (o == null || getClass() != o.getClass()) 088 return false; 089 090 ProductVariantImpl that = (ProductVariantImpl) o; 091 092 return new EqualsBuilder().append(product, that.product) 093 .append(staged, that.staged) 094 .append(variantId, that.variantId) 095 .append(product, that.product) 096 .append(staged, that.staged) 097 .append(variantId, that.variantId) 098 .isEquals(); 099 } 100 101 @Override 102 public int hashCode() { 103 return new HashCodeBuilder(17, 37).append(product).append(staged).append(variantId).toHashCode(); 104 } 105 106}