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