001
002package com.commercetools.history.models.change_value;
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 * InventoryQuantityValue
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class InventoryQuantityValueImpl implements InventoryQuantityValue, ModelBase {
022
023    private Integer quantityOnStock;
024
025    private Integer availableQuantity;
026
027    /**
028     * create instance with all properties
029     */
030    @JsonCreator
031    InventoryQuantityValueImpl(@JsonProperty("quantityOnStock") final Integer quantityOnStock,
032            @JsonProperty("availableQuantity") final Integer availableQuantity) {
033        this.quantityOnStock = quantityOnStock;
034        this.availableQuantity = availableQuantity;
035    }
036
037    /**
038     * create empty instance
039     */
040    public InventoryQuantityValueImpl() {
041    }
042
043    /**
044     *  <p>Overall amount of stock (<code>availableQuantity</code> + reserved).</p>
045     */
046
047    public Integer getQuantityOnStock() {
048        return this.quantityOnStock;
049    }
050
051    /**
052     *  <p>Available amount of stock (<code>quantityOnStock</code> - reserved).</p>
053     */
054
055    public Integer getAvailableQuantity() {
056        return this.availableQuantity;
057    }
058
059    public void setQuantityOnStock(final Integer quantityOnStock) {
060        this.quantityOnStock = quantityOnStock;
061    }
062
063    public void setAvailableQuantity(final Integer availableQuantity) {
064        this.availableQuantity = availableQuantity;
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        InventoryQuantityValueImpl that = (InventoryQuantityValueImpl) o;
076
077        return new EqualsBuilder().append(quantityOnStock, that.quantityOnStock)
078                .append(availableQuantity, that.availableQuantity)
079                .append(quantityOnStock, that.quantityOnStock)
080                .append(availableQuantity, that.availableQuantity)
081                .isEquals();
082    }
083
084    @Override
085    public int hashCode() {
086        return new HashCodeBuilder(17, 37).append(quantityOnStock).append(availableQuantity).toHashCode();
087    }
088
089}