001
002package com.commercetools.api.models.shopping_list;
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 * ShoppingListChangeTextLineItemNameActionBuilder
012 * <hr>
013 * Example to create an instance using the builder pattern
014 * <div class=code-example>
015 * <pre><code class='java'>
016 *     ShoppingListChangeTextLineItemNameAction shoppingListChangeTextLineItemNameAction = ShoppingListChangeTextLineItemNameAction.builder()
017 *             .textLineItemId("{textLineItemId}")
018 *             .name(nameBuilder -> nameBuilder)
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 ShoppingListChangeTextLineItemNameActionBuilder
025        implements Builder<ShoppingListChangeTextLineItemNameAction> {
026
027    private String textLineItemId;
028
029    private com.commercetools.api.models.common.LocalizedString name;
030
031    /**
032     *  <p>The <code>id</code> of the TextLineItem to update.</p>
033     * @param textLineItemId value to be set
034     * @return Builder
035     */
036
037    public ShoppingListChangeTextLineItemNameActionBuilder textLineItemId(final String textLineItemId) {
038        this.textLineItemId = textLineItemId;
039        return this;
040    }
041
042    /**
043     *  <p>New value to set. Must not be empty.</p>
044     * @param builder function to build the name value
045     * @return Builder
046     */
047
048    public ShoppingListChangeTextLineItemNameActionBuilder name(
049            Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedStringBuilder> builder) {
050        this.name = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()).build();
051        return this;
052    }
053
054    /**
055     *  <p>New value to set. Must not be empty.</p>
056     * @param builder function to build the name value
057     * @return Builder
058     */
059
060    public ShoppingListChangeTextLineItemNameActionBuilder withName(
061            Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedString> builder) {
062        this.name = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of());
063        return this;
064    }
065
066    /**
067     *  <p>New value to set. Must not be empty.</p>
068     * @param name value to be set
069     * @return Builder
070     */
071
072    public ShoppingListChangeTextLineItemNameActionBuilder name(
073            final com.commercetools.api.models.common.LocalizedString name) {
074        this.name = name;
075        return this;
076    }
077
078    /**
079     *  <p>The <code>id</code> of the TextLineItem to update.</p>
080     * @return textLineItemId
081     */
082
083    public String getTextLineItemId() {
084        return this.textLineItemId;
085    }
086
087    /**
088     *  <p>New value to set. Must not be empty.</p>
089     * @return name
090     */
091
092    public com.commercetools.api.models.common.LocalizedString getName() {
093        return this.name;
094    }
095
096    /**
097     * builds ShoppingListChangeTextLineItemNameAction with checking for non-null required values
098     * @return ShoppingListChangeTextLineItemNameAction
099     */
100    public ShoppingListChangeTextLineItemNameAction build() {
101        Objects.requireNonNull(textLineItemId,
102            ShoppingListChangeTextLineItemNameAction.class + ": textLineItemId is missing");
103        Objects.requireNonNull(name, ShoppingListChangeTextLineItemNameAction.class + ": name is missing");
104        return new ShoppingListChangeTextLineItemNameActionImpl(textLineItemId, name);
105    }
106
107    /**
108     * builds ShoppingListChangeTextLineItemNameAction without checking for non-null required values
109     * @return ShoppingListChangeTextLineItemNameAction
110     */
111    public ShoppingListChangeTextLineItemNameAction buildUnchecked() {
112        return new ShoppingListChangeTextLineItemNameActionImpl(textLineItemId, name);
113    }
114
115    /**
116     * factory method for an instance of ShoppingListChangeTextLineItemNameActionBuilder
117     * @return builder
118     */
119    public static ShoppingListChangeTextLineItemNameActionBuilder of() {
120        return new ShoppingListChangeTextLineItemNameActionBuilder();
121    }
122
123    /**
124     * create builder for ShoppingListChangeTextLineItemNameAction instance
125     * @param template instance with prefilled values for the builder
126     * @return builder
127     */
128    public static ShoppingListChangeTextLineItemNameActionBuilder of(
129            final ShoppingListChangeTextLineItemNameAction template) {
130        ShoppingListChangeTextLineItemNameActionBuilder builder = new ShoppingListChangeTextLineItemNameActionBuilder();
131        builder.textLineItemId = template.getTextLineItemId();
132        builder.name = template.getName();
133        return builder;
134    }
135
136}