001
002package com.commercetools.api.models.me;
003
004import java.util.*;
005
006import javax.annotation.Nullable;
007
008import io.vrap.rmf.base.client.Builder;
009import io.vrap.rmf.base.client.utils.Generated;
010
011/**
012 * MyOrderFromQuoteDraftBuilder
013 * <hr>
014 * Example to create an instance using the builder pattern
015 * <div class=code-example>
016 * <pre><code class='java'>
017 *     MyOrderFromQuoteDraft myOrderFromQuoteDraft = MyOrderFromQuoteDraft.builder()
018 *             .id("{id}")
019 *             .version(0.3)
020 *             .build()
021 * </code></pre>
022 * </div>
023 */
024@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
025public class MyOrderFromQuoteDraftBuilder implements Builder<MyOrderFromQuoteDraft> {
026
027    private String id;
028
029    private Long version;
030
031    @Nullable
032    private Boolean quoteStateToAccepted;
033
034    /**
035     *  <p>Unique identifier of the Quote from which the Order is created.</p>
036     * @param id value to be set
037     * @return Builder
038     */
039
040    public MyOrderFromQuoteDraftBuilder id(final String id) {
041        this.id = id;
042        return this;
043    }
044
045    /**
046     *  <p><code>version</code> of the Quote from which the Order is created.</p>
047     * @param version value to be set
048     * @return Builder
049     */
050
051    public MyOrderFromQuoteDraftBuilder version(final Long version) {
052        this.version = version;
053        return this;
054    }
055
056    /**
057     *  <p>Set to <code>true</code>, if the <code>quoteState</code> of the referenced Quote should be set to <code>Accepted</code>.</p>
058     * @param quoteStateToAccepted value to be set
059     * @return Builder
060     */
061
062    public MyOrderFromQuoteDraftBuilder quoteStateToAccepted(@Nullable final Boolean quoteStateToAccepted) {
063        this.quoteStateToAccepted = quoteStateToAccepted;
064        return this;
065    }
066
067    /**
068     *  <p>Unique identifier of the Quote from which the Order is created.</p>
069     * @return id
070     */
071
072    public String getId() {
073        return this.id;
074    }
075
076    /**
077     *  <p><code>version</code> of the Quote from which the Order is created.</p>
078     * @return version
079     */
080
081    public Long getVersion() {
082        return this.version;
083    }
084
085    /**
086     *  <p>Set to <code>true</code>, if the <code>quoteState</code> of the referenced Quote should be set to <code>Accepted</code>.</p>
087     * @return quoteStateToAccepted
088     */
089
090    @Nullable
091    public Boolean getQuoteStateToAccepted() {
092        return this.quoteStateToAccepted;
093    }
094
095    /**
096     * builds MyOrderFromQuoteDraft with checking for non-null required values
097     * @return MyOrderFromQuoteDraft
098     */
099    public MyOrderFromQuoteDraft build() {
100        Objects.requireNonNull(id, MyOrderFromQuoteDraft.class + ": id is missing");
101        Objects.requireNonNull(version, MyOrderFromQuoteDraft.class + ": version is missing");
102        return new MyOrderFromQuoteDraftImpl(id, version, quoteStateToAccepted);
103    }
104
105    /**
106     * builds MyOrderFromQuoteDraft without checking for non-null required values
107     * @return MyOrderFromQuoteDraft
108     */
109    public MyOrderFromQuoteDraft buildUnchecked() {
110        return new MyOrderFromQuoteDraftImpl(id, version, quoteStateToAccepted);
111    }
112
113    /**
114     * factory method for an instance of MyOrderFromQuoteDraftBuilder
115     * @return builder
116     */
117    public static MyOrderFromQuoteDraftBuilder of() {
118        return new MyOrderFromQuoteDraftBuilder();
119    }
120
121    /**
122     * create builder for MyOrderFromQuoteDraft instance
123     * @param template instance with prefilled values for the builder
124     * @return builder
125     */
126    public static MyOrderFromQuoteDraftBuilder of(final MyOrderFromQuoteDraft template) {
127        MyOrderFromQuoteDraftBuilder builder = new MyOrderFromQuoteDraftBuilder();
128        builder.id = template.getId();
129        builder.version = template.getVersion();
130        builder.quoteStateToAccepted = template.getQuoteStateToAccepted();
131        return builder;
132    }
133
134}