001
002package com.commercetools.importapi.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 *  <p>References a state by key.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class StateKeyReferenceImpl implements StateKeyReference, ModelBase {
022
023    private String key;
024
025    private com.commercetools.importapi.models.common.ReferenceType typeId;
026
027    /**
028     * create instance with all properties
029     */
030    @JsonCreator
031    StateKeyReferenceImpl(@JsonProperty("key") final String key) {
032        this.key = key;
033        this.typeId = ReferenceType.findEnum("state");
034    }
035
036    /**
037     * create empty instance
038     */
039    public StateKeyReferenceImpl() {
040        this.typeId = ReferenceType.findEnum("state");
041    }
042
043    /**
044     *
045     */
046
047    public String getKey() {
048        return this.key;
049    }
050
051    /**
052     *  <p>The type of the referenced resource.</p>
053     */
054
055    public com.commercetools.importapi.models.common.ReferenceType getTypeId() {
056        return this.typeId;
057    }
058
059    public void setKey(final String key) {
060        this.key = key;
061    }
062
063    @Override
064    public boolean equals(Object o) {
065        if (this == o)
066            return true;
067
068        if (o == null || getClass() != o.getClass())
069            return false;
070
071        StateKeyReferenceImpl that = (StateKeyReferenceImpl) o;
072
073        return new EqualsBuilder().append(key, that.key).append(typeId, that.typeId).isEquals();
074    }
075
076    @Override
077    public int hashCode() {
078        return new HashCodeBuilder(17, 37).append(key).append(typeId).toHashCode();
079    }
080
081}