001
002package com.commercetools.history.models.common;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009import javax.validation.constraints.NotNull;
010
011import com.fasterxml.jackson.annotation.*;
012import com.fasterxml.jackson.databind.annotation.*;
013
014import io.vrap.rmf.base.client.utils.Generated;
015
016/**
017 * ProductVariantChannelAvailability
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     ProductVariantChannelAvailability productVariantChannelAvailability = ProductVariantChannelAvailability.builder()
024 *             .isOnStock(true)
025 *             .restockableInDays(1)
026 *             .availableQuantity(1)
027 *             .build()
028 * </code></pre>
029 * </div>
030 */
031@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
032@JsonDeserialize(as = ProductVariantChannelAvailabilityImpl.class)
033public interface ProductVariantChannelAvailability {
034
035    /**
036     *
037     * @return isOnStock
038     */
039    @NotNull
040    @JsonProperty("isOnStock")
041    public Boolean getIsOnStock();
042
043    /**
044     *
045     * @return restockableInDays
046     */
047    @NotNull
048    @JsonProperty("restockableInDays")
049    public Integer getRestockableInDays();
050
051    /**
052     *
053     * @return availableQuantity
054     */
055    @NotNull
056    @JsonProperty("availableQuantity")
057    public Integer getAvailableQuantity();
058
059    /**
060     * set isOnStock
061     * @param isOnStock value to be set
062     */
063
064    public void setIsOnStock(final Boolean isOnStock);
065
066    /**
067     * set restockableInDays
068     * @param restockableInDays value to be set
069     */
070
071    public void setRestockableInDays(final Integer restockableInDays);
072
073    /**
074     * set availableQuantity
075     * @param availableQuantity value to be set
076     */
077
078    public void setAvailableQuantity(final Integer availableQuantity);
079
080    /**
081     * factory method
082     * @return instance of ProductVariantChannelAvailability
083     */
084    public static ProductVariantChannelAvailability of() {
085        return new ProductVariantChannelAvailabilityImpl();
086    }
087
088    /**
089     * factory method to create a shallow copy ProductVariantChannelAvailability
090     * @param template instance to be copied
091     * @return copy instance
092     */
093    public static ProductVariantChannelAvailability of(final ProductVariantChannelAvailability template) {
094        ProductVariantChannelAvailabilityImpl instance = new ProductVariantChannelAvailabilityImpl();
095        instance.setIsOnStock(template.getIsOnStock());
096        instance.setRestockableInDays(template.getRestockableInDays());
097        instance.setAvailableQuantity(template.getAvailableQuantity());
098        return instance;
099    }
100
101    /**
102     * factory method to create a deep copy of ProductVariantChannelAvailability
103     * @param template instance to be copied
104     * @return copy instance
105     */
106    @Nullable
107    public static ProductVariantChannelAvailability deepCopy(
108            @Nullable final ProductVariantChannelAvailability template) {
109        if (template == null) {
110            return null;
111        }
112        ProductVariantChannelAvailabilityImpl instance = new ProductVariantChannelAvailabilityImpl();
113        instance.setIsOnStock(template.getIsOnStock());
114        instance.setRestockableInDays(template.getRestockableInDays());
115        instance.setAvailableQuantity(template.getAvailableQuantity());
116        return instance;
117    }
118
119    /**
120     * builder factory method for ProductVariantChannelAvailability
121     * @return builder
122     */
123    public static ProductVariantChannelAvailabilityBuilder builder() {
124        return ProductVariantChannelAvailabilityBuilder.of();
125    }
126
127    /**
128     * create builder for ProductVariantChannelAvailability instance
129     * @param template instance with prefilled values for the builder
130     * @return builder
131     */
132    public static ProductVariantChannelAvailabilityBuilder builder(final ProductVariantChannelAvailability template) {
133        return ProductVariantChannelAvailabilityBuilder.of(template);
134    }
135
136    /**
137     * accessor map function
138     * @param <T> mapped type
139     * @param helper function to map the object
140     * @return mapped value
141     */
142    default <T> T withProductVariantChannelAvailability(Function<ProductVariantChannelAvailability, T> helper) {
143        return helper.apply(this);
144    }
145
146    /**
147     * gives a TypeReference for usage with Jackson DataBind
148     * @return TypeReference
149     */
150    public static com.fasterxml.jackson.core.type.TypeReference<ProductVariantChannelAvailability> typeReference() {
151        return new com.fasterxml.jackson.core.type.TypeReference<ProductVariantChannelAvailability>() {
152            @Override
153            public String toString() {
154                return "TypeReference<ProductVariantChannelAvailability>";
155            }
156        };
157    }
158}