001
002package com.commercetools.api.models.product;
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.commercetools.api.models.common.LocalizedString;
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 * ProductChangeNameAction
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     ProductChangeNameAction productChangeNameAction = ProductChangeNameAction.builder()
026 *             .name(nameBuilder -> nameBuilder)
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 = ProductChangeNameActionImpl.class)
033public interface ProductChangeNameAction extends ProductUpdateAction {
034
035    /**
036     * discriminator value for ProductChangeNameAction
037     */
038    String CHANGE_NAME = "changeName";
039
040    /**
041     *  <p>Value to set. Must not be empty.</p>
042     * @return name
043     */
044    @NotNull
045    @Valid
046    @JsonProperty("name")
047    public LocalizedString getName();
048
049    /**
050     *  <p>If <code>true</code>, only the staged <code>name</code> is updated. If <code>false</code>, both the current and staged <code>name</code> are updated.</p>
051     * @return staged
052     */
053
054    @JsonProperty("staged")
055    public Boolean getStaged();
056
057    /**
058     *  <p>Value to set. Must not be empty.</p>
059     * @param name value to be set
060     */
061
062    public void setName(final LocalizedString name);
063
064    /**
065     *  <p>If <code>true</code>, only the staged <code>name</code> is updated. If <code>false</code>, both the current and staged <code>name</code> are updated.</p>
066     * @param staged value to be set
067     */
068
069    public void setStaged(final Boolean staged);
070
071    /**
072     * factory method
073     * @return instance of ProductChangeNameAction
074     */
075    public static ProductChangeNameAction of() {
076        return new ProductChangeNameActionImpl();
077    }
078
079    /**
080     * factory method to create a shallow copy ProductChangeNameAction
081     * @param template instance to be copied
082     * @return copy instance
083     */
084    public static ProductChangeNameAction of(final ProductChangeNameAction template) {
085        ProductChangeNameActionImpl instance = new ProductChangeNameActionImpl();
086        instance.setName(template.getName());
087        instance.setStaged(template.getStaged());
088        return instance;
089    }
090
091    /**
092     * factory method to create a deep copy of ProductChangeNameAction
093     * @param template instance to be copied
094     * @return copy instance
095     */
096    @Nullable
097    public static ProductChangeNameAction deepCopy(@Nullable final ProductChangeNameAction template) {
098        if (template == null) {
099            return null;
100        }
101        ProductChangeNameActionImpl instance = new ProductChangeNameActionImpl();
102        instance.setName(com.commercetools.api.models.common.LocalizedString.deepCopy(template.getName()));
103        instance.setStaged(template.getStaged());
104        return instance;
105    }
106
107    /**
108     * builder factory method for ProductChangeNameAction
109     * @return builder
110     */
111    public static ProductChangeNameActionBuilder builder() {
112        return ProductChangeNameActionBuilder.of();
113    }
114
115    /**
116     * create builder for ProductChangeNameAction instance
117     * @param template instance with prefilled values for the builder
118     * @return builder
119     */
120    public static ProductChangeNameActionBuilder builder(final ProductChangeNameAction template) {
121        return ProductChangeNameActionBuilder.of(template);
122    }
123
124    /**
125     * accessor map function
126     * @param <T> mapped type
127     * @param helper function to map the object
128     * @return mapped value
129     */
130    default <T> T withProductChangeNameAction(Function<ProductChangeNameAction, T> helper) {
131        return helper.apply(this);
132    }
133
134    /**
135     * gives a TypeReference for usage with Jackson DataBind
136     * @return TypeReference
137     */
138    public static com.fasterxml.jackson.core.type.TypeReference<ProductChangeNameAction> typeReference() {
139        return new com.fasterxml.jackson.core.type.TypeReference<ProductChangeNameAction>() {
140            @Override
141            public String toString() {
142                return "TypeReference<ProductChangeNameAction>";
143            }
144        };
145    }
146}