001
002package com.commercetools.ml.models.common;
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 * ProductTypeReference
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ProductTypeReferenceImpl implements ProductTypeReference, ModelBase {
022
023    private com.commercetools.ml.models.common.ReferenceTypeId typeId;
024
025    private String id;
026
027    @JsonCreator
028    ProductTypeReferenceImpl(@JsonProperty("id") final String id) {
029        this.id = id;
030        this.typeId = ReferenceTypeId.findEnum("product-type");
031    }
032
033    public ProductTypeReferenceImpl() {
034        this.typeId = ReferenceTypeId.findEnum("product-type");
035    }
036
037    /**
038     *
039     */
040
041    public com.commercetools.ml.models.common.ReferenceTypeId getTypeId() {
042        return this.typeId;
043    }
044
045    /**
046     *
047     */
048
049    public String getId() {
050        return this.id;
051    }
052
053    public void setId(final String id) {
054        this.id = id;
055    }
056
057    @Override
058    public boolean equals(Object o) {
059        if (this == o)
060            return true;
061
062        if (o == null || getClass() != o.getClass())
063            return false;
064
065        ProductTypeReferenceImpl that = (ProductTypeReferenceImpl) o;
066
067        return new EqualsBuilder().append(typeId, that.typeId).append(id, that.id).isEquals();
068    }
069
070    @Override
071    public int hashCode() {
072        return new HashCodeBuilder(17, 37).append(typeId).append(id).toHashCode();
073    }
074
075}