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 nesting Attributes based on some existing ProductType. It does not support <code>isSearchable</code> and is not supported in queries. The only supported AttributeConstraint is <code>None</code>.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class AttributeNestedTypeImpl implements AttributeNestedType, ModelBase { 022 023 private String name; 024 025 private com.commercetools.api.models.product_type.ProductTypeReference typeReference; 026 027 /** 028 * create instance with all properties 029 */ 030 @JsonCreator 031 AttributeNestedTypeImpl( 032 @JsonProperty("typeReference") final com.commercetools.api.models.product_type.ProductTypeReference typeReference) { 033 this.typeReference = typeReference; 034 this.name = NESTED; 035 } 036 037 /** 038 * create empty instance 039 */ 040 public AttributeNestedTypeImpl() { 041 this.name = NESTED; 042 } 043 044 /** 045 * 046 */ 047 048 public String getName() { 049 return this.name; 050 } 051 052 /** 053 * <p>Attributes that can be stored as nested Attributes of the current Attribute.</p> 054 */ 055 056 public com.commercetools.api.models.product_type.ProductTypeReference getTypeReference() { 057 return this.typeReference; 058 } 059 060 public void setTypeReference(final com.commercetools.api.models.product_type.ProductTypeReference typeReference) { 061 this.typeReference = typeReference; 062 } 063 064 @Override 065 public boolean equals(Object o) { 066 if (this == o) 067 return true; 068 069 if (o == null || getClass() != o.getClass()) 070 return false; 071 072 AttributeNestedTypeImpl that = (AttributeNestedTypeImpl) o; 073 074 return new EqualsBuilder().append(name, that.name).append(typeReference, that.typeReference).isEquals(); 075 } 076 077 @Override 078 public int hashCode() { 079 return new HashCodeBuilder(17, 37).append(name).append(typeReference).toHashCode(); 080 } 081 082}