001
002package com.commercetools.api.models.attribute_group;
003
004import java.util.*;
005import java.util.function.Function;
006
007import io.vrap.rmf.base.client.Builder;
008import io.vrap.rmf.base.client.utils.Generated;
009
010/**
011 * AttributeGroupChangeNameActionBuilder
012 * <hr>
013 * Example to create an instance using the builder pattern
014 * <div class=code-example>
015 * <pre><code class='java'>
016 *     AttributeGroupChangeNameAction attributeGroupChangeNameAction = AttributeGroupChangeNameAction.builder()
017 *             .name(nameBuilder -> nameBuilder)
018 *             .build()
019 * </code></pre>
020 * </div>
021 */
022@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
023public class AttributeGroupChangeNameActionBuilder implements Builder<AttributeGroupChangeNameAction> {
024
025    private com.commercetools.api.models.common.LocalizedString name;
026
027    /**
028     *  <p>New value to set. Must not be empty.</p>
029     * @param builder function to build the name value
030     * @return Builder
031     */
032
033    public AttributeGroupChangeNameActionBuilder name(
034            Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedStringBuilder> builder) {
035        this.name = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()).build();
036        return this;
037    }
038
039    /**
040     *  <p>New value to set. Must not be empty.</p>
041     * @param builder function to build the name value
042     * @return Builder
043     */
044
045    public AttributeGroupChangeNameActionBuilder withName(
046            Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedString> builder) {
047        this.name = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of());
048        return this;
049    }
050
051    /**
052     *  <p>New value to set. Must not be empty.</p>
053     * @param name value to be set
054     * @return Builder
055     */
056
057    public AttributeGroupChangeNameActionBuilder name(final com.commercetools.api.models.common.LocalizedString name) {
058        this.name = name;
059        return this;
060    }
061
062    /**
063     *  <p>New value to set. Must not be empty.</p>
064     * @return name
065     */
066
067    public com.commercetools.api.models.common.LocalizedString getName() {
068        return this.name;
069    }
070
071    /**
072     * builds AttributeGroupChangeNameAction with checking for non-null required values
073     * @return AttributeGroupChangeNameAction
074     */
075    public AttributeGroupChangeNameAction build() {
076        Objects.requireNonNull(name, AttributeGroupChangeNameAction.class + ": name is missing");
077        return new AttributeGroupChangeNameActionImpl(name);
078    }
079
080    /**
081     * builds AttributeGroupChangeNameAction without checking for non-null required values
082     * @return AttributeGroupChangeNameAction
083     */
084    public AttributeGroupChangeNameAction buildUnchecked() {
085        return new AttributeGroupChangeNameActionImpl(name);
086    }
087
088    /**
089     * factory method for an instance of AttributeGroupChangeNameActionBuilder
090     * @return builder
091     */
092    public static AttributeGroupChangeNameActionBuilder of() {
093        return new AttributeGroupChangeNameActionBuilder();
094    }
095
096    /**
097     * create builder for AttributeGroupChangeNameAction instance
098     * @param template instance with prefilled values for the builder
099     * @return builder
100     */
101    public static AttributeGroupChangeNameActionBuilder of(final AttributeGroupChangeNameAction template) {
102        AttributeGroupChangeNameActionBuilder builder = new AttributeGroupChangeNameActionBuilder();
103        builder.name = template.getName();
104        return builder;
105    }
106
107}