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.Valid;
010import javax.validation.constraints.NotNull;
011
012import com.fasterxml.jackson.annotation.*;
013import com.fasterxml.jackson.databind.annotation.*;
014
015import io.vrap.rmf.base.client.utils.Generated;
016
017/**
018 * ProductSelectionSetting
019 *
020 * <hr>
021 * Example to create an instance using the builder pattern
022 * <div class=code-example>
023 * <pre><code class='java'>
024 *     ProductSelectionSetting productSelectionSetting = ProductSelectionSetting.builder()
025 *             .productSelection(productSelectionBuilder -> productSelectionBuilder)
026 *             .active(true)
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 = ProductSelectionSettingImpl.class)
033public interface ProductSelectionSetting {
034
035    /**
036     *
037     * @return productSelection
038     */
039    @NotNull
040    @Valid
041    @JsonProperty("productSelection")
042    public Reference getProductSelection();
043
044    /**
045     *
046     * @return active
047     */
048    @NotNull
049    @JsonProperty("active")
050    public Boolean getActive();
051
052    /**
053     * set productSelection
054     * @param productSelection value to be set
055     */
056
057    public void setProductSelection(final Reference productSelection);
058
059    /**
060     * set active
061     * @param active value to be set
062     */
063
064    public void setActive(final Boolean active);
065
066    /**
067     * factory method
068     * @return instance of ProductSelectionSetting
069     */
070    public static ProductSelectionSetting of() {
071        return new ProductSelectionSettingImpl();
072    }
073
074    /**
075     * factory method to create a shallow copy ProductSelectionSetting
076     * @param template instance to be copied
077     * @return copy instance
078     */
079    public static ProductSelectionSetting of(final ProductSelectionSetting template) {
080        ProductSelectionSettingImpl instance = new ProductSelectionSettingImpl();
081        instance.setProductSelection(template.getProductSelection());
082        instance.setActive(template.getActive());
083        return instance;
084    }
085
086    /**
087     * factory method to create a deep copy of ProductSelectionSetting
088     * @param template instance to be copied
089     * @return copy instance
090     */
091    @Nullable
092    public static ProductSelectionSetting deepCopy(@Nullable final ProductSelectionSetting template) {
093        if (template == null) {
094            return null;
095        }
096        ProductSelectionSettingImpl instance = new ProductSelectionSettingImpl();
097        instance.setProductSelection(
098            com.commercetools.history.models.common.Reference.deepCopy(template.getProductSelection()));
099        instance.setActive(template.getActive());
100        return instance;
101    }
102
103    /**
104     * builder factory method for ProductSelectionSetting
105     * @return builder
106     */
107    public static ProductSelectionSettingBuilder builder() {
108        return ProductSelectionSettingBuilder.of();
109    }
110
111    /**
112     * create builder for ProductSelectionSetting instance
113     * @param template instance with prefilled values for the builder
114     * @return builder
115     */
116    public static ProductSelectionSettingBuilder builder(final ProductSelectionSetting template) {
117        return ProductSelectionSettingBuilder.of(template);
118    }
119
120    /**
121     * accessor map function
122     * @param <T> mapped type
123     * @param helper function to map the object
124     * @return mapped value
125     */
126    default <T> T withProductSelectionSetting(Function<ProductSelectionSetting, T> helper) {
127        return helper.apply(this);
128    }
129
130    /**
131     * gives a TypeReference for usage with Jackson DataBind
132     * @return TypeReference
133     */
134    public static com.fasterxml.jackson.core.type.TypeReference<ProductSelectionSetting> typeReference() {
135        return new com.fasterxml.jackson.core.type.TypeReference<ProductSelectionSetting>() {
136            @Override
137            public String toString() {
138                return "TypeReference<ProductSelectionSetting>";
139            }
140        };
141    }
142}