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