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