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