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>Change the order of LocalizedEnumValues on Product Types.</li> 021 * <li>Change the order of LocalizedEnumValues on Types.</li> 022 * </ul> 023 */ 024@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 025public class ChangeLocalizedEnumValueOrderChangeImpl implements ChangeLocalizedEnumValueOrderChange, ModelBase { 026 027 private String type; 028 029 private String change; 030 031 private java.util.List<com.commercetools.history.models.change_value.LocalizedEnumValue> previousValue; 032 033 private java.util.List<com.commercetools.history.models.change_value.LocalizedEnumValue> nextValue; 034 035 private String fieldName; 036 037 private String attributeName; 038 039 /** 040 * create instance with all properties 041 */ 042 @JsonCreator 043 ChangeLocalizedEnumValueOrderChangeImpl(@JsonProperty("change") final String change, 044 @JsonProperty("previousValue") final java.util.List<com.commercetools.history.models.change_value.LocalizedEnumValue> previousValue, 045 @JsonProperty("nextValue") final java.util.List<com.commercetools.history.models.change_value.LocalizedEnumValue> nextValue, 046 @JsonProperty("fieldName") final String fieldName, 047 @JsonProperty("attributeName") final String attributeName) { 048 this.change = change; 049 this.previousValue = previousValue; 050 this.nextValue = nextValue; 051 this.fieldName = fieldName; 052 this.attributeName = attributeName; 053 this.type = CHANGE_LOCALIZED_ENUM_VALUE_ORDER_CHANGE; 054 } 055 056 /** 057 * create empty instance 058 */ 059 public ChangeLocalizedEnumValueOrderChangeImpl() { 060 this.type = CHANGE_LOCALIZED_ENUM_VALUE_ORDER_CHANGE; 061 } 062 063 /** 064 * 065 */ 066 067 public String getType() { 068 return this.type; 069 } 070 071 /** 072 * 073 */ 074 075 public String getChange() { 076 return this.change; 077 } 078 079 /** 080 * <p>Value before the change.</p> 081 */ 082 083 public java.util.List<com.commercetools.history.models.change_value.LocalizedEnumValue> getPreviousValue() { 084 return this.previousValue; 085 } 086 087 /** 088 * <p>Value after the change.</p> 089 */ 090 091 public java.util.List<com.commercetools.history.models.change_value.LocalizedEnumValue> getNextValue() { 092 return this.nextValue; 093 } 094 095 /** 096 * <p>Name of the updated FieldDefinition; only present on changes to Types.</p> 097 */ 098 099 public String getFieldName() { 100 return this.fieldName; 101 } 102 103 /** 104 * <p>Name of the updated AttributeDefinition; only present on changes to Product Types.</p> 105 */ 106 107 public String getAttributeName() { 108 return this.attributeName; 109 } 110 111 public void setChange(final String change) { 112 this.change = change; 113 } 114 115 public void setPreviousValue( 116 final com.commercetools.history.models.change_value.LocalizedEnumValue... previousValue) { 117 this.previousValue = new ArrayList<>(Arrays.asList(previousValue)); 118 } 119 120 public void setPreviousValue( 121 final java.util.List<com.commercetools.history.models.change_value.LocalizedEnumValue> previousValue) { 122 this.previousValue = previousValue; 123 } 124 125 public void setNextValue(final com.commercetools.history.models.change_value.LocalizedEnumValue... nextValue) { 126 this.nextValue = new ArrayList<>(Arrays.asList(nextValue)); 127 } 128 129 public void setNextValue( 130 final java.util.List<com.commercetools.history.models.change_value.LocalizedEnumValue> nextValue) { 131 this.nextValue = nextValue; 132 } 133 134 public void setFieldName(final String fieldName) { 135 this.fieldName = fieldName; 136 } 137 138 public void setAttributeName(final String attributeName) { 139 this.attributeName = attributeName; 140 } 141 142 @Override 143 public boolean equals(Object o) { 144 if (this == o) 145 return true; 146 147 if (o == null || getClass() != o.getClass()) 148 return false; 149 150 ChangeLocalizedEnumValueOrderChangeImpl that = (ChangeLocalizedEnumValueOrderChangeImpl) o; 151 152 return new EqualsBuilder().append(type, that.type) 153 .append(change, that.change) 154 .append(previousValue, that.previousValue) 155 .append(nextValue, that.nextValue) 156 .append(fieldName, that.fieldName) 157 .append(attributeName, that.attributeName) 158 .append(type, that.type) 159 .append(change, that.change) 160 .append(previousValue, that.previousValue) 161 .append(nextValue, that.nextValue) 162 .append(fieldName, that.fieldName) 163 .append(attributeName, that.attributeName) 164 .isEquals(); 165 } 166 167 @Override 168 public int hashCode() { 169 return new HashCodeBuilder(17, 37).append(type) 170 .append(change) 171 .append(previousValue) 172 .append(nextValue) 173 .append(fieldName) 174 .append(attributeName) 175 .toHashCode(); 176 } 177 178}