001 002package com.commercetools.history.models.change; 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>Change triggered by the Set LineItemTaxRate update action.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class SetLineItemTaxRateChangeImpl implements SetLineItemTaxRateChange, ModelBase { 022 023 private String type; 024 025 private String change; 026 027 private com.commercetools.history.models.common.TaxRate previousValue; 028 029 private com.commercetools.history.models.common.TaxRate nextValue; 030 031 private com.commercetools.history.models.common.LocalizedString lineItem; 032 033 private String variant; 034 035 private com.commercetools.history.models.common.TaxMode taxMode; 036 037 /** 038 * create instance with all properties 039 */ 040 @JsonCreator 041 SetLineItemTaxRateChangeImpl(@JsonProperty("change") final String change, 042 @JsonProperty("previousValue") final com.commercetools.history.models.common.TaxRate previousValue, 043 @JsonProperty("nextValue") final com.commercetools.history.models.common.TaxRate nextValue, 044 @JsonProperty("lineItem") final com.commercetools.history.models.common.LocalizedString lineItem, 045 @JsonProperty("variant") final String variant, 046 @JsonProperty("taxMode") final com.commercetools.history.models.common.TaxMode taxMode) { 047 this.change = change; 048 this.previousValue = previousValue; 049 this.nextValue = nextValue; 050 this.lineItem = lineItem; 051 this.variant = variant; 052 this.taxMode = taxMode; 053 this.type = SET_LINE_ITEM_TAX_RATE_CHANGE; 054 } 055 056 /** 057 * create empty instance 058 */ 059 public SetLineItemTaxRateChangeImpl() { 060 this.type = SET_LINE_ITEM_TAX_RATE_CHANGE; 061 } 062 063 /** 064 * 065 */ 066 067 public String getType() { 068 return this.type; 069 } 070 071 /** 072 * 073 */ 074 075 public String getChange() { 076 return this.change; 077 } 078 079 /** 080 * <p>Value before the change.</p> 081 */ 082 083 public com.commercetools.history.models.common.TaxRate getPreviousValue() { 084 return this.previousValue; 085 } 086 087 /** 088 * <p>Value after the change.</p> 089 */ 090 091 public com.commercetools.history.models.common.TaxRate getNextValue() { 092 return this.nextValue; 093 } 094 095 /** 096 * <p>Name of the Product the Line Item is based on.</p> 097 */ 098 099 public com.commercetools.history.models.common.LocalizedString getLineItem() { 100 return this.lineItem; 101 } 102 103 /** 104 * <p><code>sku</code> or <code>key</code> of the ProductVariant.</p> 105 */ 106 107 public String getVariant() { 108 return this.variant; 109 } 110 111 /** 112 * <p><code>"External"</code></p> 113 */ 114 115 public com.commercetools.history.models.common.TaxMode getTaxMode() { 116 return this.taxMode; 117 } 118 119 public void setChange(final String change) { 120 this.change = change; 121 } 122 123 public void setPreviousValue(final com.commercetools.history.models.common.TaxRate previousValue) { 124 this.previousValue = previousValue; 125 } 126 127 public void setNextValue(final com.commercetools.history.models.common.TaxRate nextValue) { 128 this.nextValue = nextValue; 129 } 130 131 public void setLineItem(final com.commercetools.history.models.common.LocalizedString lineItem) { 132 this.lineItem = lineItem; 133 } 134 135 public void setVariant(final String variant) { 136 this.variant = variant; 137 } 138 139 public void setTaxMode(final com.commercetools.history.models.common.TaxMode taxMode) { 140 this.taxMode = taxMode; 141 } 142 143 @Override 144 public boolean equals(Object o) { 145 if (this == o) 146 return true; 147 148 if (o == null || getClass() != o.getClass()) 149 return false; 150 151 SetLineItemTaxRateChangeImpl that = (SetLineItemTaxRateChangeImpl) o; 152 153 return new EqualsBuilder().append(type, that.type) 154 .append(change, that.change) 155 .append(previousValue, that.previousValue) 156 .append(nextValue, that.nextValue) 157 .append(lineItem, that.lineItem) 158 .append(variant, that.variant) 159 .append(taxMode, that.taxMode) 160 .append(type, that.type) 161 .append(change, that.change) 162 .append(previousValue, that.previousValue) 163 .append(nextValue, that.nextValue) 164 .append(lineItem, that.lineItem) 165 .append(variant, that.variant) 166 .append(taxMode, that.taxMode) 167 .isEquals(); 168 } 169 170 @Override 171 public int hashCode() { 172 return new HashCodeBuilder(17, 37).append(type) 173 .append(change) 174 .append(previousValue) 175 .append(nextValue) 176 .append(lineItem) 177 .append(variant) 178 .append(taxMode) 179 .toHashCode(); 180 } 181 182}