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