001 002package com.commercetools.history.models.change_value; 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 * ChangeValueGiftLineItemChangeValue 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class ChangeValueGiftLineItemChangeValueImpl implements ChangeValueGiftLineItemChangeValue, ModelBase { 022 023 private String type; 024 025 private com.commercetools.history.models.common.Reference product; 026 027 private Integer variantId; 028 029 private com.commercetools.history.models.common.Reference supplyChannel; 030 031 private com.commercetools.history.models.common.Reference distributionChannel; 032 033 /** 034 * create instance with all properties 035 */ 036 @JsonCreator 037 ChangeValueGiftLineItemChangeValueImpl( 038 @JsonProperty("product") final com.commercetools.history.models.common.Reference product, 039 @JsonProperty("variantId") final Integer variantId, 040 @JsonProperty("supplyChannel") final com.commercetools.history.models.common.Reference supplyChannel, 041 @JsonProperty("distributionChannel") final com.commercetools.history.models.common.Reference distributionChannel) { 042 this.product = product; 043 this.variantId = variantId; 044 this.supplyChannel = supplyChannel; 045 this.distributionChannel = distributionChannel; 046 this.type = GIFT_LINE_ITEM; 047 } 048 049 /** 050 * create empty instance 051 */ 052 public ChangeValueGiftLineItemChangeValueImpl() { 053 this.type = GIFT_LINE_ITEM; 054 } 055 056 /** 057 * 058 */ 059 060 public String getType() { 061 return this.type; 062 } 063 064 /** 065 * <p>Reference to a Product.</p> 066 */ 067 068 public com.commercetools.history.models.common.Reference getProduct() { 069 return this.product; 070 } 071 072 /** 073 * <p><code>id</code> of the ProductVariant.</p> 074 */ 075 076 public Integer getVariantId() { 077 return this.variantId; 078 } 079 080 /** 081 * <p>Channel with ChannelRoleEnum <code>InventorySupply</code>.</p> 082 */ 083 084 public com.commercetools.history.models.common.Reference getSupplyChannel() { 085 return this.supplyChannel; 086 } 087 088 /** 089 * <p>Channel with ChannelRoleEnum <code>ProductDistribution</code>.</p> 090 */ 091 092 public com.commercetools.history.models.common.Reference getDistributionChannel() { 093 return this.distributionChannel; 094 } 095 096 public void setProduct(final com.commercetools.history.models.common.Reference product) { 097 this.product = product; 098 } 099 100 public void setVariantId(final Integer variantId) { 101 this.variantId = variantId; 102 } 103 104 public void setSupplyChannel(final com.commercetools.history.models.common.Reference supplyChannel) { 105 this.supplyChannel = supplyChannel; 106 } 107 108 public void setDistributionChannel(final com.commercetools.history.models.common.Reference distributionChannel) { 109 this.distributionChannel = distributionChannel; 110 } 111 112 @Override 113 public boolean equals(Object o) { 114 if (this == o) 115 return true; 116 117 if (o == null || getClass() != o.getClass()) 118 return false; 119 120 ChangeValueGiftLineItemChangeValueImpl that = (ChangeValueGiftLineItemChangeValueImpl) o; 121 122 return new EqualsBuilder().append(type, that.type) 123 .append(product, that.product) 124 .append(variantId, that.variantId) 125 .append(supplyChannel, that.supplyChannel) 126 .append(distributionChannel, that.distributionChannel) 127 .append(type, that.type) 128 .append(product, that.product) 129 .append(variantId, that.variantId) 130 .append(supplyChannel, that.supplyChannel) 131 .append(distributionChannel, that.distributionChannel) 132 .isEquals(); 133 } 134 135 @Override 136 public int hashCode() { 137 return new HashCodeBuilder(17, 37).append(type) 138 .append(product) 139 .append(variantId) 140 .append(supplyChannel) 141 .append(distributionChannel) 142 .toHashCode(); 143 } 144 145}