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 * TaxedPrice 019 * 020 * <hr> 021 * Example to create an instance using the builder pattern 022 * <div class=code-example> 023 * <pre><code class='java'> 024 * TaxedPrice taxedPrice = TaxedPrice.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 = TaxedPriceImpl.class) 033public interface TaxedPrice { 034 035 /** 036 * <p>Total net price of the Order.</p> 037 * @return totalNet 038 */ 039 @NotNull 040 @Valid 041 @JsonProperty("totalNet") 042 public Money getTotalNet(); 043 044 /** 045 * <p>Total gross price of the Order.</p> 046 * @return totalGross 047 */ 048 @NotNull 049 @Valid 050 @JsonProperty("totalGross") 051 public Money getTotalGross(); 052 053 /** 054 * <p>Total net price of the Order.</p> 055 * @param totalNet value to be set 056 */ 057 058 public void setTotalNet(final Money totalNet); 059 060 /** 061 * <p>Total gross price of the Order.</p> 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 TaxedPrice 070 */ 071 public static TaxedPrice of() { 072 return new TaxedPriceImpl(); 073 } 074 075 /** 076 * factory method to create a shallow copy TaxedPrice 077 * @param template instance to be copied 078 * @return copy instance 079 */ 080 public static TaxedPrice of(final TaxedPrice template) { 081 TaxedPriceImpl instance = new TaxedPriceImpl(); 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 TaxedPrice 089 * @param template instance to be copied 090 * @return copy instance 091 */ 092 @Nullable 093 public static TaxedPrice deepCopy(@Nullable final TaxedPrice template) { 094 if (template == null) { 095 return null; 096 } 097 TaxedPriceImpl instance = new TaxedPriceImpl(); 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 TaxedPrice 105 * @return builder 106 */ 107 public static TaxedPriceBuilder builder() { 108 return TaxedPriceBuilder.of(); 109 } 110 111 /** 112 * create builder for TaxedPrice instance 113 * @param template instance with prefilled values for the builder 114 * @return builder 115 */ 116 public static TaxedPriceBuilder builder(final TaxedPrice template) { 117 return TaxedPriceBuilder.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 withTaxedPrice(Function<TaxedPrice, 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<TaxedPrice> typeReference() { 135 return new com.fasterxml.jackson.core.type.TypeReference<TaxedPrice>() { 136 @Override 137 public String toString() { 138 return "TypeReference<TaxedPrice>"; 139 } 140 }; 141 } 142}