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 * ProductVariantAvailability
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ProductVariantAvailabilityImpl implements ProductVariantAvailability, ModelBase {
022
023    private Boolean isOnStock;
024
025    private Integer restockableInDays;
026
027    private Integer availableQuantity;
028
029    private com.commercetools.history.models.common.ProductVariantChannelAvailabilityMap channels;
030
031    /**
032     * create instance with all properties
033     */
034    @JsonCreator
035    ProductVariantAvailabilityImpl(@JsonProperty("isOnStock") final Boolean isOnStock,
036            @JsonProperty("restockableInDays") final Integer restockableInDays,
037            @JsonProperty("availableQuantity") final Integer availableQuantity,
038            @JsonProperty("channels") final com.commercetools.history.models.common.ProductVariantChannelAvailabilityMap channels) {
039        this.isOnStock = isOnStock;
040        this.restockableInDays = restockableInDays;
041        this.availableQuantity = availableQuantity;
042        this.channels = channels;
043    }
044
045    /**
046     * create empty instance
047     */
048    public ProductVariantAvailabilityImpl() {
049    }
050
051    /**
052     *
053     */
054
055    public Boolean getIsOnStock() {
056        return this.isOnStock;
057    }
058
059    /**
060     *
061     */
062
063    public Integer getRestockableInDays() {
064        return this.restockableInDays;
065    }
066
067    /**
068     *
069     */
070
071    public Integer getAvailableQuantity() {
072        return this.availableQuantity;
073    }
074
075    /**
076     *
077     */
078
079    public com.commercetools.history.models.common.ProductVariantChannelAvailabilityMap getChannels() {
080        return this.channels;
081    }
082
083    public void setIsOnStock(final Boolean isOnStock) {
084        this.isOnStock = isOnStock;
085    }
086
087    public void setRestockableInDays(final Integer restockableInDays) {
088        this.restockableInDays = restockableInDays;
089    }
090
091    public void setAvailableQuantity(final Integer availableQuantity) {
092        this.availableQuantity = availableQuantity;
093    }
094
095    public void setChannels(
096            final com.commercetools.history.models.common.ProductVariantChannelAvailabilityMap channels) {
097        this.channels = channels;
098    }
099
100    @Override
101    public boolean equals(Object o) {
102        if (this == o)
103            return true;
104
105        if (o == null || getClass() != o.getClass())
106            return false;
107
108        ProductVariantAvailabilityImpl that = (ProductVariantAvailabilityImpl) o;
109
110        return new EqualsBuilder().append(isOnStock, that.isOnStock)
111                .append(restockableInDays, that.restockableInDays)
112                .append(availableQuantity, that.availableQuantity)
113                .append(channels, that.channels)
114                .append(isOnStock, that.isOnStock)
115                .append(restockableInDays, that.restockableInDays)
116                .append(availableQuantity, that.availableQuantity)
117                .append(channels, that.channels)
118                .isEquals();
119    }
120
121    @Override
122    public int hashCode() {
123        return new HashCodeBuilder(17, 37).append(isOnStock)
124                .append(restockableInDays)
125                .append(availableQuantity)
126                .append(channels)
127                .toHashCode();
128    }
129
130}