001 002package com.commercetools.api.models.associate_role; 003 004import java.time.*; 005import java.util.*; 006 007import com.commercetools.api.models.common.ReferenceTypeId; 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>Reference to an AssociateRole.</p> 020 */ 021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 022public class AssociateRoleReferenceImpl implements AssociateRoleReference, ModelBase { 023 024 private com.commercetools.api.models.common.ReferenceTypeId typeId; 025 026 private String id; 027 028 private com.commercetools.api.models.associate_role.AssociateRole obj; 029 030 /** 031 * create instance with all properties 032 */ 033 @JsonCreator 034 AssociateRoleReferenceImpl(@JsonProperty("id") final String id, 035 @JsonProperty("obj") final com.commercetools.api.models.associate_role.AssociateRole obj) { 036 this.id = id; 037 this.obj = obj; 038 this.typeId = ReferenceTypeId.findEnum("associate-role"); 039 } 040 041 /** 042 * create empty instance 043 */ 044 public AssociateRoleReferenceImpl() { 045 this.typeId = ReferenceTypeId.findEnum("associate-role"); 046 } 047 048 /** 049 * <p>Type of referenced resource.</p> 050 */ 051 052 public com.commercetools.api.models.common.ReferenceTypeId getTypeId() { 053 return this.typeId; 054 } 055 056 /** 057 * <p>Unique identifier of the referenced AssociateRole.</p> 058 */ 059 060 public String getId() { 061 return this.id; 062 } 063 064 /** 065 * <p>Contains the representation of the expanded AssociateRole. Only present in responses to requests with Reference Expansion for AssociateRole.</p> 066 */ 067 068 public com.commercetools.api.models.associate_role.AssociateRole getObj() { 069 return this.obj; 070 } 071 072 public void setId(final String id) { 073 this.id = id; 074 } 075 076 public void setObj(final com.commercetools.api.models.associate_role.AssociateRole obj) { 077 this.obj = obj; 078 } 079 080 @Override 081 public boolean equals(Object o) { 082 if (this == o) 083 return true; 084 085 if (o == null || getClass() != o.getClass()) 086 return false; 087 088 AssociateRoleReferenceImpl that = (AssociateRoleReferenceImpl) o; 089 090 return new EqualsBuilder().append(typeId, that.typeId) 091 .append(id, that.id) 092 .append(obj, that.obj) 093 .append(typeId, that.typeId) 094 .append(id, that.id) 095 .append(obj, that.obj) 096 .isEquals(); 097 } 098 099 @Override 100 public int hashCode() { 101 return new HashCodeBuilder(17, 37).append(typeId).append(id).append(obj).toHashCode(); 102 } 103 104}