001 002package com.commercetools.api.models.standalone_price; 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>ResourceIdentifier to a StandalonePrice.</p> 020 */ 021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 022public class StandalonePriceResourceIdentifierImpl implements StandalonePriceResourceIdentifier, ModelBase { 023 024 private com.commercetools.api.models.common.ReferenceTypeId typeId; 025 026 private String id; 027 028 private String key; 029 030 /** 031 * create instance with all properties 032 */ 033 @JsonCreator 034 StandalonePriceResourceIdentifierImpl(@JsonProperty("id") final String id, @JsonProperty("key") final String key) { 035 this.id = id; 036 this.key = key; 037 this.typeId = ReferenceTypeId.findEnum("standalone-price"); 038 } 039 040 /** 041 * create empty instance 042 */ 043 public StandalonePriceResourceIdentifierImpl() { 044 this.typeId = ReferenceTypeId.findEnum("standalone-price"); 045 } 046 047 /** 048 * <p>Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.</p> 049 */ 050 051 public com.commercetools.api.models.common.ReferenceTypeId getTypeId() { 052 return this.typeId; 053 } 054 055 /** 056 * <p>Unique identifier of the referenced resource. Required if <code>key</code> is absent.</p> 057 */ 058 059 public String getId() { 060 return this.id; 061 } 062 063 /** 064 * <p>User-defined unique identifier of the referenced resource. Required if <code>id</code> is absent.</p> 065 */ 066 067 public String getKey() { 068 return this.key; 069 } 070 071 public void setId(final String id) { 072 this.id = id; 073 } 074 075 public void setKey(final String key) { 076 this.key = key; 077 } 078 079 @Override 080 public boolean equals(Object o) { 081 if (this == o) 082 return true; 083 084 if (o == null || getClass() != o.getClass()) 085 return false; 086 087 StandalonePriceResourceIdentifierImpl that = (StandalonePriceResourceIdentifierImpl) o; 088 089 return new EqualsBuilder().append(typeId, that.typeId).append(id, that.id).append(key, that.key).isEquals(); 090 } 091 092 @Override 093 public int hashCode() { 094 return new HashCodeBuilder(17, 37).append(typeId).append(id).append(key).toHashCode(); 095 } 096 097}