001 002package com.commercetools.api.models.project; 003 004import java.time.*; 005import java.util.*; 006 007import com.commercetools.api.models.shipping_method.ShippingRateTierType; 008import com.fasterxml.jackson.annotation.JsonCreator; 009import com.fasterxml.jackson.annotation.JsonProperty; 010import com.fasterxml.jackson.databind.annotation.*; 011 012import io.vrap.rmf.base.client.ModelBase; 013import io.vrap.rmf.base.client.utils.Generated; 014 015import org.apache.commons.lang3.builder.EqualsBuilder; 016import org.apache.commons.lang3.builder.HashCodeBuilder; 017 018/** 019 * <p>Used when the ShippingRate maps to an abstract Cart categorization expressed by strings (for example, <code>Light</code>, <code>Medium</code>, or <code>Heavy</code>). Only keys defined in the <code>values</code> array can be used to create a tier or to set a value of the <code>shippingRateInput</code> on the Cart. Keys must be unique.</p> 020 */ 021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 022public class CartClassificationTypeImpl implements CartClassificationType, ModelBase { 023 024 private com.commercetools.api.models.shipping_method.ShippingRateTierType type; 025 026 private java.util.List<com.commercetools.api.models.type.CustomFieldLocalizedEnumValue> values; 027 028 /** 029 * create instance with all properties 030 */ 031 @JsonCreator 032 CartClassificationTypeImpl( 033 @JsonProperty("values") final java.util.List<com.commercetools.api.models.type.CustomFieldLocalizedEnumValue> values) { 034 this.values = values; 035 this.type = ShippingRateTierType.findEnum("CartClassification"); 036 } 037 038 /** 039 * create empty instance 040 */ 041 public CartClassificationTypeImpl() { 042 this.type = ShippingRateTierType.findEnum("CartClassification"); 043 } 044 045 /** 046 * 047 */ 048 049 public com.commercetools.api.models.shipping_method.ShippingRateTierType getType() { 050 return this.type; 051 } 052 053 /** 054 * <p>The classification items that can be used for specifying any ShippingRatePriceTier.</p> 055 */ 056 057 public java.util.List<com.commercetools.api.models.type.CustomFieldLocalizedEnumValue> getValues() { 058 return this.values; 059 } 060 061 public void setValues(final com.commercetools.api.models.type.CustomFieldLocalizedEnumValue... values) { 062 this.values = new ArrayList<>(Arrays.asList(values)); 063 } 064 065 public void setValues( 066 final java.util.List<com.commercetools.api.models.type.CustomFieldLocalizedEnumValue> values) { 067 this.values = values; 068 } 069 070 @Override 071 public boolean equals(Object o) { 072 if (this == o) 073 return true; 074 075 if (o == null || getClass() != o.getClass()) 076 return false; 077 078 CartClassificationTypeImpl that = (CartClassificationTypeImpl) o; 079 080 return new EqualsBuilder().append(type, that.type).append(values, that.values).isEquals(); 081 } 082 083 @Override 084 public int hashCode() { 085 return new HashCodeBuilder(17, 37).append(type).append(values).toHashCode(); 086 } 087 088}