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 Change EnumValue Label update action.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class ChangeEnumValueLabelChangeImpl implements ChangeEnumValueLabelChange, ModelBase { 022 023 private String type; 024 025 private String change; 026 027 private String previousValue; 028 029 private String nextValue; 030 031 private String fieldName; 032 033 private String valueKey; 034 035 /** 036 * create instance with all properties 037 */ 038 @JsonCreator 039 ChangeEnumValueLabelChangeImpl(@JsonProperty("change") final String change, 040 @JsonProperty("previousValue") final String previousValue, 041 @JsonProperty("nextValue") final String nextValue, @JsonProperty("fieldName") final String fieldName, 042 @JsonProperty("valueKey") final String valueKey) { 043 this.change = change; 044 this.previousValue = previousValue; 045 this.nextValue = nextValue; 046 this.fieldName = fieldName; 047 this.valueKey = valueKey; 048 this.type = CHANGE_ENUM_VALUE_LABEL_CHANGE; 049 } 050 051 /** 052 * create empty instance 053 */ 054 public ChangeEnumValueLabelChangeImpl() { 055 this.type = CHANGE_ENUM_VALUE_LABEL_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 String getPreviousValue() { 079 return this.previousValue; 080 } 081 082 /** 083 * <p>Value after the change.</p> 084 */ 085 086 public String getNextValue() { 087 return this.nextValue; 088 } 089 090 /** 091 * <p>Name of the updated FieldDefinition.</p> 092 */ 093 094 public String getFieldName() { 095 return this.fieldName; 096 } 097 098 /** 099 * <p>Key of the updated values.</p> 100 */ 101 102 public String getValueKey() { 103 return this.valueKey; 104 } 105 106 public void setChange(final String change) { 107 this.change = change; 108 } 109 110 public void setPreviousValue(final String previousValue) { 111 this.previousValue = previousValue; 112 } 113 114 public void setNextValue(final String nextValue) { 115 this.nextValue = nextValue; 116 } 117 118 public void setFieldName(final String fieldName) { 119 this.fieldName = fieldName; 120 } 121 122 public void setValueKey(final String valueKey) { 123 this.valueKey = valueKey; 124 } 125 126 @Override 127 public boolean equals(Object o) { 128 if (this == o) 129 return true; 130 131 if (o == null || getClass() != o.getClass()) 132 return false; 133 134 ChangeEnumValueLabelChangeImpl that = (ChangeEnumValueLabelChangeImpl) o; 135 136 return new EqualsBuilder().append(type, that.type) 137 .append(change, that.change) 138 .append(previousValue, that.previousValue) 139 .append(nextValue, that.nextValue) 140 .append(fieldName, that.fieldName) 141 .append(valueKey, that.valueKey) 142 .append(type, that.type) 143 .append(change, that.change) 144 .append(previousValue, that.previousValue) 145 .append(nextValue, that.nextValue) 146 .append(fieldName, that.fieldName) 147 .append(valueKey, that.valueKey) 148 .isEquals(); 149 } 150 151 @Override 152 public int hashCode() { 153 return new HashCodeBuilder(17, 37).append(type) 154 .append(change) 155 .append(previousValue) 156 .append(nextValue) 157 .append(fieldName) 158 .append(valueKey) 159 .toHashCode(); 160 } 161 162}