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

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

There is a newer version: 1.0.0-M26
Show newest version
package io.sphere.sdk.carts;

import com.fasterxml.jackson.annotation.JsonCreator;
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;

public class CartShippingInfo extends Base {
    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;

    @JsonCreator
    protected CartShippingInfo(final String shippingMethodName, final MonetaryAmount price, final ShippingRate shippingRate, final TaxRate taxRate, final Reference taxCategory, final Reference shippingMethod) {
        this.shippingMethodName = shippingMethodName;
        this.price = price;
        this.shippingRate = shippingRate;
        this.taxRate = taxRate;
        this.taxCategory = taxCategory;
        this.shippingMethod = shippingMethod;
    }

    public static CartShippingInfo of(final String shippingMethodName, final MonetaryAmount price, final ShippingRate shippingRate, final TaxRate taxRate, final Reference taxCategory, final Reference shippingMethod) {
        return new CartShippingInfo(shippingMethodName, price, shippingRate, taxRate, taxCategory, shippingMethod);
    }

    public String getShippingMethodName() {
        return shippingMethodName;
    }

    public MonetaryAmount getPrice() {
        return price;
    }

    public ShippingRate getShippingRate() {
        return shippingRate;
    }

    public TaxRate getTaxRate() {
        return taxRate;
    }

    public Reference getTaxCategory() {
        return taxCategory;
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy