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