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