001
002package com.commercetools.history.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 * ItemShippingTarget
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ItemShippingTargetImpl implements ItemShippingTarget, ModelBase {
022
023    private String addressKey;
024
025    private Integer quantity;
026
027    /**
028     * create instance with all properties
029     */
030    @JsonCreator
031    ItemShippingTargetImpl(@JsonProperty("addressKey") final String addressKey,
032            @JsonProperty("quantity") final Integer quantity) {
033        this.addressKey = addressKey;
034        this.quantity = quantity;
035    }
036
037    /**
038     * create empty instance
039     */
040    public ItemShippingTargetImpl() {
041    }
042
043    /**
044     *  <p>The key of the address in the cart's <code>itemShippingAddresses</code></p>
045     */
046
047    public String getAddressKey() {
048        return this.addressKey;
049    }
050
051    /**
052     *  <p>The quantity of items that should go to the address with the specified <code>addressKey</code>. Only positive values are allowed. Using <code>0</code> as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.</p>
053     */
054
055    public Integer getQuantity() {
056        return this.quantity;
057    }
058
059    public void setAddressKey(final String addressKey) {
060        this.addressKey = addressKey;
061    }
062
063    public void setQuantity(final Integer quantity) {
064        this.quantity = quantity;
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        ItemShippingTargetImpl that = (ItemShippingTargetImpl) o;
076
077        return new EqualsBuilder().append(addressKey, that.addressKey)
078                .append(quantity, that.quantity)
079                .append(addressKey, that.addressKey)
080                .append(quantity, that.quantity)
081                .isEquals();
082    }
083
084    @Override
085    public int hashCode() {
086        return new HashCodeBuilder(17, 37).append(addressKey).append(quantity).toHashCode();
087    }
088
089}