001
002package com.commercetools.api.models.product_type;
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 * ProductTypeAddLocalizedEnumValueActionBuilder
012 * <hr>
013 * Example to create an instance using the builder pattern
014 * <div class=code-example>
015 * <pre><code class='java'>
016 *     ProductTypeAddLocalizedEnumValueAction productTypeAddLocalizedEnumValueAction = ProductTypeAddLocalizedEnumValueAction.builder()
017 *             .attributeName("{attributeName}")
018 *             .value(valueBuilder -> valueBuilder)
019 *             .build()
020 * </code></pre>
021 * </div>
022 */
023@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
024public class ProductTypeAddLocalizedEnumValueActionBuilder implements Builder<ProductTypeAddLocalizedEnumValueAction> {
025
026    private String attributeName;
027
028    private com.commercetools.api.models.product_type.AttributeLocalizedEnumValue value;
029
030    /**
031     *  <p>Name of the AttributeDefinition to update.</p>
032     * @param attributeName value to be set
033     * @return Builder
034     */
035
036    public ProductTypeAddLocalizedEnumValueActionBuilder attributeName(final String attributeName) {
037        this.attributeName = attributeName;
038        return this;
039    }
040
041    /**
042     *  <p>Value to append to the array.</p>
043     * @param builder function to build the value value
044     * @return Builder
045     */
046
047    public ProductTypeAddLocalizedEnumValueActionBuilder value(
048            Function<com.commercetools.api.models.product_type.AttributeLocalizedEnumValueBuilder, com.commercetools.api.models.product_type.AttributeLocalizedEnumValueBuilder> builder) {
049        this.value = builder.apply(com.commercetools.api.models.product_type.AttributeLocalizedEnumValueBuilder.of())
050                .build();
051        return this;
052    }
053
054    /**
055     *  <p>Value to append to the array.</p>
056     * @param builder function to build the value value
057     * @return Builder
058     */
059
060    public ProductTypeAddLocalizedEnumValueActionBuilder withValue(
061            Function<com.commercetools.api.models.product_type.AttributeLocalizedEnumValueBuilder, com.commercetools.api.models.product_type.AttributeLocalizedEnumValue> builder) {
062        this.value = builder.apply(com.commercetools.api.models.product_type.AttributeLocalizedEnumValueBuilder.of());
063        return this;
064    }
065
066    /**
067     *  <p>Value to append to the array.</p>
068     * @param value value to be set
069     * @return Builder
070     */
071
072    public ProductTypeAddLocalizedEnumValueActionBuilder value(
073            final com.commercetools.api.models.product_type.AttributeLocalizedEnumValue value) {
074        this.value = value;
075        return this;
076    }
077
078    /**
079     *  <p>Name of the AttributeDefinition to update.</p>
080     * @return attributeName
081     */
082
083    public String getAttributeName() {
084        return this.attributeName;
085    }
086
087    /**
088     *  <p>Value to append to the array.</p>
089     * @return value
090     */
091
092    public com.commercetools.api.models.product_type.AttributeLocalizedEnumValue getValue() {
093        return this.value;
094    }
095
096    /**
097     * builds ProductTypeAddLocalizedEnumValueAction with checking for non-null required values
098     * @return ProductTypeAddLocalizedEnumValueAction
099     */
100    public ProductTypeAddLocalizedEnumValueAction build() {
101        Objects.requireNonNull(attributeName,
102            ProductTypeAddLocalizedEnumValueAction.class + ": attributeName is missing");
103        Objects.requireNonNull(value, ProductTypeAddLocalizedEnumValueAction.class + ": value is missing");
104        return new ProductTypeAddLocalizedEnumValueActionImpl(attributeName, value);
105    }
106
107    /**
108     * builds ProductTypeAddLocalizedEnumValueAction without checking for non-null required values
109     * @return ProductTypeAddLocalizedEnumValueAction
110     */
111    public ProductTypeAddLocalizedEnumValueAction buildUnchecked() {
112        return new ProductTypeAddLocalizedEnumValueActionImpl(attributeName, value);
113    }
114
115    /**
116     * factory method for an instance of ProductTypeAddLocalizedEnumValueActionBuilder
117     * @return builder
118     */
119    public static ProductTypeAddLocalizedEnumValueActionBuilder of() {
120        return new ProductTypeAddLocalizedEnumValueActionBuilder();
121    }
122
123    /**
124     * create builder for ProductTypeAddLocalizedEnumValueAction instance
125     * @param template instance with prefilled values for the builder
126     * @return builder
127     */
128    public static ProductTypeAddLocalizedEnumValueActionBuilder of(
129            final ProductTypeAddLocalizedEnumValueAction template) {
130        ProductTypeAddLocalizedEnumValueActionBuilder builder = new ProductTypeAddLocalizedEnumValueActionBuilder();
131        builder.attributeName = template.getAttributeName();
132        builder.value = template.getValue();
133        return builder;
134    }
135
136}