001
002package com.commercetools.api.models.cart;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009import javax.validation.constraints.NotNull;
010
011import com.fasterxml.jackson.annotation.*;
012import com.fasterxml.jackson.databind.annotation.*;
013
014import io.vrap.rmf.base.client.utils.Generated;
015
016/**
017 * ScoreShippingRateInputDraft
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     ScoreShippingRateInputDraft scoreShippingRateInputDraft = ScoreShippingRateInputDraft.builder()
024 *             .score(0.3)
025 *             .build()
026 * </code></pre>
027 * </div>
028 */
029@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
030@JsonDeserialize(as = ScoreShippingRateInputDraftImpl.class)
031public interface ScoreShippingRateInputDraft
032        extends ShippingRateInputDraft, io.vrap.rmf.base.client.Draft<ScoreShippingRateInputDraft> {
033
034    /**
035     * discriminator value for ScoreShippingRateInputDraft
036     */
037    String SCORE = "Score";
038
039    /**
040     *  <p>Abstract value for categorizing a Cart.</p>
041     * @return score
042     */
043    @NotNull
044    @JsonProperty("score")
045    public Long getScore();
046
047    /**
048     *  <p>Abstract value for categorizing a Cart.</p>
049     * @param score value to be set
050     */
051
052    public void setScore(final Long score);
053
054    /**
055     * factory method
056     * @return instance of ScoreShippingRateInputDraft
057     */
058    public static ScoreShippingRateInputDraft of() {
059        return new ScoreShippingRateInputDraftImpl();
060    }
061
062    /**
063     * factory method to create a shallow copy ScoreShippingRateInputDraft
064     * @param template instance to be copied
065     * @return copy instance
066     */
067    public static ScoreShippingRateInputDraft of(final ScoreShippingRateInputDraft template) {
068        ScoreShippingRateInputDraftImpl instance = new ScoreShippingRateInputDraftImpl();
069        instance.setScore(template.getScore());
070        return instance;
071    }
072
073    /**
074     * factory method to create a deep copy of ScoreShippingRateInputDraft
075     * @param template instance to be copied
076     * @return copy instance
077     */
078    @Nullable
079    public static ScoreShippingRateInputDraft deepCopy(@Nullable final ScoreShippingRateInputDraft template) {
080        if (template == null) {
081            return null;
082        }
083        ScoreShippingRateInputDraftImpl instance = new ScoreShippingRateInputDraftImpl();
084        instance.setScore(template.getScore());
085        return instance;
086    }
087
088    /**
089     * builder factory method for ScoreShippingRateInputDraft
090     * @return builder
091     */
092    public static ScoreShippingRateInputDraftBuilder builder() {
093        return ScoreShippingRateInputDraftBuilder.of();
094    }
095
096    /**
097     * create builder for ScoreShippingRateInputDraft instance
098     * @param template instance with prefilled values for the builder
099     * @return builder
100     */
101    public static ScoreShippingRateInputDraftBuilder builder(final ScoreShippingRateInputDraft template) {
102        return ScoreShippingRateInputDraftBuilder.of(template);
103    }
104
105    /**
106     * accessor map function
107     * @param <T> mapped type
108     * @param helper function to map the object
109     * @return mapped value
110     */
111    default <T> T withScoreShippingRateInputDraft(Function<ScoreShippingRateInputDraft, T> helper) {
112        return helper.apply(this);
113    }
114
115    /**
116     * gives a TypeReference for usage with Jackson DataBind
117     * @return TypeReference
118     */
119    public static com.fasterxml.jackson.core.type.TypeReference<ScoreShippingRateInputDraft> typeReference() {
120        return new com.fasterxml.jackson.core.type.TypeReference<ScoreShippingRateInputDraft>() {
121            @Override
122            public String toString() {
123                return "TypeReference<ScoreShippingRateInputDraft>";
124            }
125        };
126    }
127}