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