All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.carts.CartShippingInfoImpl Maven / Gradle / Ivy

There is a newer version: 2.16.0
Show newest version
package io.sphere.sdk.carts;

import com.fasterxml.jackson.annotation.JsonCreator;
import io.sphere.sdk.cartdiscounts.DiscountedLineItemPrice;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.shippingmethods.ShippingMethod;
import io.sphere.sdk.shippingmethods.ShippingRate;
import io.sphere.sdk.taxcategories.TaxCategory;
import io.sphere.sdk.taxcategories.TaxRate;

import javax.annotation.Nullable;
import javax.money.MonetaryAmount;

/**
 * Internal class to implement shipping infos
 */
public class CartShippingInfoImpl extends Base implements CartShippingInfo {
    private final String shippingMethodName;
    private final MonetaryAmount price;
    private final ShippingRate shippingRate;
    private final TaxRate taxRate;
    private final Reference taxCategory;
    @Nullable
    private final Reference shippingMethod;
    @Nullable
    private final TaxedItemPrice taxedPrice;
    @Nullable
    private final DiscountedLineItemPrice discountedPrice;

    @JsonCreator
    protected CartShippingInfoImpl(final String shippingMethodName, final MonetaryAmount price, final ShippingRate shippingRate, final TaxRate taxRate, final Reference taxCategory, @Nullable final Reference shippingMethod, @Nullable final TaxedItemPrice taxedPrice, @Nullable final DiscountedLineItemPrice discountedPrice) {
        this.shippingMethodName = shippingMethodName;
        this.price = price;
        this.shippingRate = shippingRate;
        this.taxRate = taxRate;
        this.taxCategory = taxCategory;
        this.shippingMethod = shippingMethod;
        this.taxedPrice = taxedPrice;
        this.discountedPrice = discountedPrice;
    }

    @Override
    public String getShippingMethodName() {
        return shippingMethodName;
    }

    @Override
    public MonetaryAmount getPrice() {
        return price;
    }

    @Override
    public ShippingRate getShippingRate() {
        return shippingRate;
    }

    @Override
    public TaxRate getTaxRate() {
        return taxRate;
    }

    @Override
    public Reference getTaxCategory() {
        return taxCategory;
    }

    @Override
    @Nullable
    public Reference getShippingMethod() {
        return shippingMethod;
    }

    @Override
    @Nullable
    public TaxedItemPrice getTaxedPrice() {
        return taxedPrice;
    }

    @Override
    @Nullable
    public DiscountedLineItemPrice getDiscountedPrice() {
        return discountedPrice;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy