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

io.sphere.sdk.shippingmethods.ShippingRate Maven / Gradle / Ivy

The newest version!
package io.sphere.sdk.shippingmethods;

import io.sphere.sdk.models.Base;

import javax.money.MonetaryAmount;
import java.util.Optional;

public class ShippingRate extends Base {
    private final MonetaryAmount price;
    private final Optional freeAbove;

    private ShippingRate(final MonetaryAmount price, final Optional freeAbove) {
        this.price = price;
        this.freeAbove = freeAbove;
    }

    public static ShippingRate of(final MonetaryAmount price, final Optional freeAbove) {
        return new ShippingRate(price, freeAbove);
    }

    public static ShippingRate of(final MonetaryAmount price) {
        return of(price, Optional.empty());
    }

    public MonetaryAmount getPrice() {
        return price;
    }

    public Optional getFreeAbove() {
        return freeAbove;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy