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 * ScoreShippingRateInput 018 * 019 * <hr> 020 * Example to create an instance using the builder pattern 021 * <div class=code-example> 022 * <pre><code class='java'> 023 * ScoreShippingRateInput scoreShippingRateInput = ScoreShippingRateInput.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 = ScoreShippingRateInputImpl.class) 031public interface ScoreShippingRateInput extends ShippingRateInput { 032 033 /** 034 * discriminator value for ScoreShippingRateInput 035 */ 036 String SCORE = "Score"; 037 038 /** 039 * <p>Abstract value for categorizing a Cart.</p> 040 * @return score 041 */ 042 @NotNull 043 @JsonProperty("score") 044 public Long getScore(); 045 046 /** 047 * <p>Abstract value for categorizing a Cart.</p> 048 * @param score value to be set 049 */ 050 051 public void setScore(final Long score); 052 053 /** 054 * factory method 055 * @return instance of ScoreShippingRateInput 056 */ 057 public static ScoreShippingRateInput of() { 058 return new ScoreShippingRateInputImpl(); 059 } 060 061 /** 062 * factory method to create a shallow copy ScoreShippingRateInput 063 * @param template instance to be copied 064 * @return copy instance 065 */ 066 public static ScoreShippingRateInput of(final ScoreShippingRateInput template) { 067 ScoreShippingRateInputImpl instance = new ScoreShippingRateInputImpl(); 068 instance.setScore(template.getScore()); 069 return instance; 070 } 071 072 /** 073 * factory method to create a deep copy of ScoreShippingRateInput 074 * @param template instance to be copied 075 * @return copy instance 076 */ 077 @Nullable 078 public static ScoreShippingRateInput deepCopy(@Nullable final ScoreShippingRateInput template) { 079 if (template == null) { 080 return null; 081 } 082 ScoreShippingRateInputImpl instance = new ScoreShippingRateInputImpl(); 083 instance.setScore(template.getScore()); 084 return instance; 085 } 086 087 /** 088 * builder factory method for ScoreShippingRateInput 089 * @return builder 090 */ 091 public static ScoreShippingRateInputBuilder builder() { 092 return ScoreShippingRateInputBuilder.of(); 093 } 094 095 /** 096 * create builder for ScoreShippingRateInput instance 097 * @param template instance with prefilled values for the builder 098 * @return builder 099 */ 100 public static ScoreShippingRateInputBuilder builder(final ScoreShippingRateInput template) { 101 return ScoreShippingRateInputBuilder.of(template); 102 } 103 104 /** 105 * accessor map function 106 * @param <T> mapped type 107 * @param helper function to map the object 108 * @return mapped value 109 */ 110 default <T> T withScoreShippingRateInput(Function<ScoreShippingRateInput, T> helper) { 111 return helper.apply(this); 112 } 113 114 /** 115 * gives a TypeReference for usage with Jackson DataBind 116 * @return TypeReference 117 */ 118 public static com.fasterxml.jackson.core.type.TypeReference<ScoreShippingRateInput> typeReference() { 119 return new com.fasterxml.jackson.core.type.TypeReference<ScoreShippingRateInput>() { 120 @Override 121 public String toString() { 122 return "TypeReference<ScoreShippingRateInput>"; 123 } 124 }; 125 } 126}