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