001 002package com.commercetools.api.models.product_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>Attribute type for plain enum values. Useful for predefined language-agnostic values selectable in drop downs when only one value should be selected. Use AttributeSetType of AttributeEnumType instead if multiple values can be selected from the list.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class AttributeEnumTypeImpl implements AttributeEnumType, ModelBase { 022 023 private String name; 024 025 private java.util.List<com.commercetools.api.models.product_type.AttributePlainEnumValue> values; 026 027 /** 028 * create instance with all properties 029 */ 030 @JsonCreator 031 AttributeEnumTypeImpl( 032 @JsonProperty("values") final java.util.List<com.commercetools.api.models.product_type.AttributePlainEnumValue> values) { 033 this.values = values; 034 this.name = ENUM; 035 } 036 037 /** 038 * create empty instance 039 */ 040 public AttributeEnumTypeImpl() { 041 this.name = ENUM; 042 } 043 044 /** 045 * 046 */ 047 048 public String getName() { 049 return this.name; 050 } 051 052 /** 053 * <p>Available values that can be assigned to Products.</p> 054 */ 055 056 public java.util.List<com.commercetools.api.models.product_type.AttributePlainEnumValue> getValues() { 057 return this.values; 058 } 059 060 public void setValues(final com.commercetools.api.models.product_type.AttributePlainEnumValue... values) { 061 this.values = new ArrayList<>(Arrays.asList(values)); 062 } 063 064 public void setValues( 065 final java.util.List<com.commercetools.api.models.product_type.AttributePlainEnumValue> values) { 066 this.values = values; 067 } 068 069 @Override 070 public boolean equals(Object o) { 071 if (this == o) 072 return true; 073 074 if (o == null || getClass() != o.getClass()) 075 return false; 076 077 AttributeEnumTypeImpl that = (AttributeEnumTypeImpl) o; 078 079 return new EqualsBuilder().append(name, that.name) 080 .append(values, that.values) 081 .append(name, that.name) 082 .append(values, that.values) 083 .isEquals(); 084 } 085 086 @Override 087 public int hashCode() { 088 return new HashCodeBuilder(17, 37).append(name).append(values).toHashCode(); 089 } 090 091}