001
002package com.commercetools.api.models.category;
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 a Category.</p>
020 */
021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
022public class CategoryReferenceImpl implements CategoryReference, ModelBase {
023
024    private com.commercetools.api.models.common.ReferenceTypeId typeId;
025
026    private String id;
027
028    private com.commercetools.api.models.category.Category obj;
029
030    /**
031     * create instance with all properties
032     */
033    @JsonCreator
034    CategoryReferenceImpl(@JsonProperty("id") final String id,
035            @JsonProperty("obj") final com.commercetools.api.models.category.Category obj) {
036        this.id = id;
037        this.obj = obj;
038        this.typeId = ReferenceTypeId.findEnum("category");
039    }
040
041    /**
042     * create empty instance
043     */
044    public CategoryReferenceImpl() {
045        this.typeId = ReferenceTypeId.findEnum("category");
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 Category.</p>
058     */
059
060    public String getId() {
061        return this.id;
062    }
063
064    /**
065     *  <p>Contains the representation of the expanded Category. Only present in responses to requests with Reference Expansion for Categories.</p>
066     */
067
068    public com.commercetools.api.models.category.Category 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.category.Category 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        CategoryReferenceImpl that = (CategoryReferenceImpl) o;
089
090        return new EqualsBuilder().append(typeId, that.typeId).append(id, that.id).append(obj, that.obj).isEquals();
091    }
092
093    @Override
094    public int hashCode() {
095        return new HashCodeBuilder(17, 37).append(typeId).append(id).append(obj).toHashCode();
096    }
097
098}