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