001 002package com.commercetools.api.models.type; 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>Changes the order of LocalizedEnumValues in a LocalizedEnumType FieldDefinition. This update action can be used to update a LocalizedEnumType FieldDefinition and a SetType of LocalizedEnumType FieldDefinitions.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class TypeChangeLocalizedEnumValueOrderActionImpl implements TypeChangeLocalizedEnumValueOrderAction, ModelBase { 022 023 private String action; 024 025 private String fieldName; 026 027 private java.util.List<String> keys; 028 029 /** 030 * create instance with all properties 031 */ 032 @JsonCreator 033 TypeChangeLocalizedEnumValueOrderActionImpl(@JsonProperty("fieldName") final String fieldName, 034 @JsonProperty("keys") final java.util.List<String> keys) { 035 this.fieldName = fieldName; 036 this.keys = keys; 037 this.action = CHANGE_LOCALIZED_ENUM_VALUE_ORDER; 038 } 039 040 /** 041 * create empty instance 042 */ 043 public TypeChangeLocalizedEnumValueOrderActionImpl() { 044 this.action = CHANGE_LOCALIZED_ENUM_VALUE_ORDER; 045 } 046 047 /** 048 * 049 */ 050 051 public String getAction() { 052 return this.action; 053 } 054 055 /** 056 * <p><code>name</code> of the Field Definition to update.</p> 057 */ 058 059 public String getFieldName() { 060 return this.fieldName; 061 } 062 063 /** 064 * <p>Must match the set of <code>key</code>s of the LocalizedEnumValues in the FieldDefinition (up to order).</p> 065 */ 066 067 public java.util.List<String> getKeys() { 068 return this.keys; 069 } 070 071 public void setFieldName(final String fieldName) { 072 this.fieldName = fieldName; 073 } 074 075 public void setKeys(final String... keys) { 076 this.keys = new ArrayList<>(Arrays.asList(keys)); 077 } 078 079 public void setKeys(final java.util.List<String> keys) { 080 this.keys = keys; 081 } 082 083 @Override 084 public boolean equals(Object o) { 085 if (this == o) 086 return true; 087 088 if (o == null || getClass() != o.getClass()) 089 return false; 090 091 TypeChangeLocalizedEnumValueOrderActionImpl that = (TypeChangeLocalizedEnumValueOrderActionImpl) o; 092 093 return new EqualsBuilder().append(action, that.action) 094 .append(fieldName, that.fieldName) 095 .append(keys, that.keys) 096 .isEquals(); 097 } 098 099 @Override 100 public int hashCode() { 101 return new HashCodeBuilder(17, 37).append(action).append(fieldName).append(keys).toHashCode(); 102 } 103 104}