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