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>Add LocalizableEnumValue to AttributeDefinition on Product Types.</li> 021 * <li>Add LocalizedEnumValue to FieldDefinition on Types.</li> 022 * </ul> 023 */ 024@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 025public class AddLocalizedEnumValueChangeImpl implements AddLocalizedEnumValueChange, ModelBase { 026 027 private String type; 028 029 private String change; 030 031 private com.commercetools.history.models.change_value.LocalizedEnumValue nextValue; 032 033 private String fieldName; 034 035 private String attributeName; 036 037 /** 038 * create instance with all properties 039 */ 040 @JsonCreator 041 AddLocalizedEnumValueChangeImpl(@JsonProperty("change") final String change, 042 @JsonProperty("nextValue") final com.commercetools.history.models.change_value.LocalizedEnumValue nextValue, 043 @JsonProperty("fieldName") final String fieldName, 044 @JsonProperty("attributeName") final String attributeName) { 045 this.change = change; 046 this.nextValue = nextValue; 047 this.fieldName = fieldName; 048 this.attributeName = attributeName; 049 this.type = ADD_LOCALIZED_ENUM_VALUE_CHANGE; 050 } 051 052 /** 053 * create empty instance 054 */ 055 public AddLocalizedEnumValueChangeImpl() { 056 this.type = ADD_LOCALIZED_ENUM_VALUE_CHANGE; 057 } 058 059 /** 060 * 061 */ 062 063 public String getType() { 064 return this.type; 065 } 066 067 /** 068 * 069 */ 070 071 public String getChange() { 072 return this.change; 073 } 074 075 /** 076 * <p>Value after the change.</p> 077 */ 078 079 public com.commercetools.history.models.change_value.LocalizedEnumValue getNextValue() { 080 return this.nextValue; 081 } 082 083 /** 084 * <p>Name of the updated FieldDefinition; only present on changes to Types.</p> 085 */ 086 087 public String getFieldName() { 088 return this.fieldName; 089 } 090 091 /** 092 * <p>Name of the updated AttributeDefinition; only present on changes to Product Types.</p> 093 */ 094 095 public String getAttributeName() { 096 return this.attributeName; 097 } 098 099 public void setChange(final String change) { 100 this.change = change; 101 } 102 103 public void setNextValue(final com.commercetools.history.models.change_value.LocalizedEnumValue nextValue) { 104 this.nextValue = nextValue; 105 } 106 107 public void setFieldName(final String fieldName) { 108 this.fieldName = fieldName; 109 } 110 111 public void setAttributeName(final String attributeName) { 112 this.attributeName = attributeName; 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 AddLocalizedEnumValueChangeImpl that = (AddLocalizedEnumValueChangeImpl) o; 124 125 return new EqualsBuilder().append(type, that.type) 126 .append(change, that.change) 127 .append(nextValue, that.nextValue) 128 .append(fieldName, that.fieldName) 129 .append(attributeName, that.attributeName) 130 .append(type, that.type) 131 .append(change, that.change) 132 .append(nextValue, that.nextValue) 133 .append(fieldName, that.fieldName) 134 .append(attributeName, that.attributeName) 135 .isEquals(); 136 } 137 138 @Override 139 public int hashCode() { 140 return new HashCodeBuilder(17, 37).append(type) 141 .append(change) 142 .append(nextValue) 143 .append(fieldName) 144 .append(attributeName) 145 .toHashCode(); 146 } 147 148}