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

io.sphere.client.shop.model.ShippingRate Maven / Gradle / Ivy

There is a newer version: 0.72.1
Show newest version
package io.sphere.client.shop.model;

import javax.annotation.Nonnull;
import io.sphere.client.model.Money;

/** A shipping rate defines the cost of shipping an order. */
public class ShippingRate {
    @Nonnull private Money price;
    private Money freeAbove;

    // for JSON deserializer
    private ShippingRate() {}

    public ShippingRate(@Nonnull Money price) { this.price = price; }

    public ShippingRate(@Nonnull Money price, Money freeAbove) {
        this.price = price;
        this.freeAbove = freeAbove;
    }

    /** The price of the shipping. */
    @Nonnull public Money getPrice() { return price; }

    /** The shipping is free if the order total (the sum of line item prices) exceeds the freeAbove value. */
    public Money getFreeAbove() { return freeAbove; }

    @Override
    public String toString() {
        return "ShippingRate{" +
                "price=" + price +
                ", freeAbove=" + freeAbove +
                '}';
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy