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