001 002package com.commercetools.history.models.change_value; 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 * SetCartScoreShippingRateInputValue 018 * 019 * <hr> 020 * Example to create an instance using the builder pattern 021 * <div class=code-example> 022 * <pre><code class='java'> 023 * SetCartScoreShippingRateInputValue setCartScoreShippingRateInputValue = SetCartScoreShippingRateInputValue.builder() 024 * .type("{type}") 025 * .score(1) 026 * .build() 027 * </code></pre> 028 * </div> 029 */ 030@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 031@JsonDeserialize(as = SetCartScoreShippingRateInputValueImpl.class) 032public interface SetCartScoreShippingRateInputValue { 033 034 /** 035 * 036 * @return type 037 */ 038 @NotNull 039 @JsonProperty("type") 040 public String getType(); 041 042 /** 043 * <p>Abstract value for categorizing a Cart.</p> 044 * @return score 045 */ 046 @NotNull 047 @JsonProperty("score") 048 public Integer getScore(); 049 050 /** 051 * set type 052 * @param type value to be set 053 */ 054 055 public void setType(final String type); 056 057 /** 058 * <p>Abstract value for categorizing a Cart.</p> 059 * @param score value to be set 060 */ 061 062 public void setScore(final Integer score); 063 064 /** 065 * factory method 066 * @return instance of SetCartScoreShippingRateInputValue 067 */ 068 public static SetCartScoreShippingRateInputValue of() { 069 return new SetCartScoreShippingRateInputValueImpl(); 070 } 071 072 /** 073 * factory method to create a shallow copy SetCartScoreShippingRateInputValue 074 * @param template instance to be copied 075 * @return copy instance 076 */ 077 public static SetCartScoreShippingRateInputValue of(final SetCartScoreShippingRateInputValue template) { 078 SetCartScoreShippingRateInputValueImpl instance = new SetCartScoreShippingRateInputValueImpl(); 079 instance.setType(template.getType()); 080 instance.setScore(template.getScore()); 081 return instance; 082 } 083 084 /** 085 * factory method to create a deep copy of SetCartScoreShippingRateInputValue 086 * @param template instance to be copied 087 * @return copy instance 088 */ 089 @Nullable 090 public static SetCartScoreShippingRateInputValue deepCopy( 091 @Nullable final SetCartScoreShippingRateInputValue template) { 092 if (template == null) { 093 return null; 094 } 095 SetCartScoreShippingRateInputValueImpl instance = new SetCartScoreShippingRateInputValueImpl(); 096 instance.setType(template.getType()); 097 instance.setScore(template.getScore()); 098 return instance; 099 } 100 101 /** 102 * builder factory method for SetCartScoreShippingRateInputValue 103 * @return builder 104 */ 105 public static SetCartScoreShippingRateInputValueBuilder builder() { 106 return SetCartScoreShippingRateInputValueBuilder.of(); 107 } 108 109 /** 110 * create builder for SetCartScoreShippingRateInputValue instance 111 * @param template instance with prefilled values for the builder 112 * @return builder 113 */ 114 public static SetCartScoreShippingRateInputValueBuilder builder(final SetCartScoreShippingRateInputValue template) { 115 return SetCartScoreShippingRateInputValueBuilder.of(template); 116 } 117 118 /** 119 * accessor map function 120 * @param <T> mapped type 121 * @param helper function to map the object 122 * @return mapped value 123 */ 124 default <T> T withSetCartScoreShippingRateInputValue(Function<SetCartScoreShippingRateInputValue, T> helper) { 125 return helper.apply(this); 126 } 127 128 /** 129 * gives a TypeReference for usage with Jackson DataBind 130 * @return TypeReference 131 */ 132 public static com.fasterxml.jackson.core.type.TypeReference<SetCartScoreShippingRateInputValue> typeReference() { 133 return new com.fasterxml.jackson.core.type.TypeReference<SetCartScoreShippingRateInputValue>() { 134 @Override 135 public String toString() { 136 return "TypeReference<SetCartScoreShippingRateInputValue>"; 137 } 138 }; 139 } 140}