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