001
002package com.commercetools.api.models.attribute_group;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009
010import com.fasterxml.jackson.annotation.*;
011import com.fasterxml.jackson.databind.annotation.*;
012
013import io.vrap.rmf.base.client.utils.Generated;
014
015/**
016 * AttributeGroupSetKeyAction
017 *
018 * <hr>
019 * Example to create an instance using the builder pattern
020 * <div class=code-example>
021 * <pre><code class='java'>
022 *     AttributeGroupSetKeyAction attributeGroupSetKeyAction = AttributeGroupSetKeyAction.builder()
023 *             .build()
024 * </code></pre>
025 * </div>
026 */
027@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
028@JsonDeserialize(as = AttributeGroupSetKeyActionImpl.class)
029public interface AttributeGroupSetKeyAction extends AttributeGroupUpdateAction {
030
031    /**
032     * discriminator value for AttributeGroupSetKeyAction
033     */
034    String SET_KEY = "setKey";
035
036    /**
037     *  <p>If <code>key</code> is absent or <code>null</code>, the existing key, if any, will be removed.</p>
038     * @return key
039     */
040
041    @JsonProperty("key")
042    public String getKey();
043
044    /**
045     *  <p>If <code>key</code> is absent or <code>null</code>, the existing key, if any, will be removed.</p>
046     * @param key value to be set
047     */
048
049    public void setKey(final String key);
050
051    /**
052     * factory method
053     * @return instance of AttributeGroupSetKeyAction
054     */
055    public static AttributeGroupSetKeyAction of() {
056        return new AttributeGroupSetKeyActionImpl();
057    }
058
059    /**
060     * factory method to create a shallow copy AttributeGroupSetKeyAction
061     * @param template instance to be copied
062     * @return copy instance
063     */
064    public static AttributeGroupSetKeyAction of(final AttributeGroupSetKeyAction template) {
065        AttributeGroupSetKeyActionImpl instance = new AttributeGroupSetKeyActionImpl();
066        instance.setKey(template.getKey());
067        return instance;
068    }
069
070    /**
071     * factory method to create a deep copy of AttributeGroupSetKeyAction
072     * @param template instance to be copied
073     * @return copy instance
074     */
075    @Nullable
076    public static AttributeGroupSetKeyAction deepCopy(@Nullable final AttributeGroupSetKeyAction template) {
077        if (template == null) {
078            return null;
079        }
080        AttributeGroupSetKeyActionImpl instance = new AttributeGroupSetKeyActionImpl();
081        instance.setKey(template.getKey());
082        return instance;
083    }
084
085    /**
086     * builder factory method for AttributeGroupSetKeyAction
087     * @return builder
088     */
089    public static AttributeGroupSetKeyActionBuilder builder() {
090        return AttributeGroupSetKeyActionBuilder.of();
091    }
092
093    /**
094     * create builder for AttributeGroupSetKeyAction instance
095     * @param template instance with prefilled values for the builder
096     * @return builder
097     */
098    public static AttributeGroupSetKeyActionBuilder builder(final AttributeGroupSetKeyAction template) {
099        return AttributeGroupSetKeyActionBuilder.of(template);
100    }
101
102    /**
103     * accessor map function
104     * @param <T> mapped type
105     * @param helper function to map the object
106     * @return mapped value
107     */
108    default <T> T withAttributeGroupSetKeyAction(Function<AttributeGroupSetKeyAction, T> helper) {
109        return helper.apply(this);
110    }
111
112    public static AttributeGroupSetKeyAction ofUnset() {
113        return AttributeGroupSetKeyAction.of();
114    }
115
116    /**
117     * gives a TypeReference for usage with Jackson DataBind
118     * @return TypeReference
119     */
120    public static com.fasterxml.jackson.core.type.TypeReference<AttributeGroupSetKeyAction> typeReference() {
121        return new com.fasterxml.jackson.core.type.TypeReference<AttributeGroupSetKeyAction>() {
122            @Override
123            public String toString() {
124                return "TypeReference<AttributeGroupSetKeyAction>";
125            }
126        };
127    }
128}