001
002package com.commercetools.api.models.cart;
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>Used for replicating an existing Cart or Order.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ReplicaCartDraftImpl implements ReplicaCartDraft, ModelBase {
022
023    private com.commercetools.api.models.common.Reference reference;
024
025    private String key;
026
027    /**
028     * create instance with all properties
029     */
030    @JsonCreator
031    ReplicaCartDraftImpl(@JsonProperty("reference") final com.commercetools.api.models.common.Reference reference,
032            @JsonProperty("key") final String key) {
033        this.reference = reference;
034        this.key = key;
035    }
036
037    /**
038     * create empty instance
039     */
040    public ReplicaCartDraftImpl() {
041    }
042
043    /**
044     *  <p>A Reference represents a loose reference to another resource in the same Project identified by its <code>id</code>. The <code>typeId</code> indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional <code>obj</code> field then.</p>
045     */
046
047    public com.commercetools.api.models.common.Reference getReference() {
048        return this.reference;
049    }
050
051    /**
052     *  <p>User-defined unique identifier for the Cart.</p>
053     */
054
055    public String getKey() {
056        return this.key;
057    }
058
059    public void setReference(final com.commercetools.api.models.common.Reference reference) {
060        this.reference = reference;
061    }
062
063    public void setKey(final String key) {
064        this.key = key;
065    }
066
067    @Override
068    public boolean equals(Object o) {
069        if (this == o)
070            return true;
071
072        if (o == null || getClass() != o.getClass())
073            return false;
074
075        ReplicaCartDraftImpl that = (ReplicaCartDraftImpl) o;
076
077        return new EqualsBuilder().append(reference, that.reference).append(key, that.key).isEquals();
078    }
079
080    @Override
081    public int hashCode() {
082        return new HashCodeBuilder(17, 37).append(reference).append(key).toHashCode();
083    }
084
085}