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

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

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

import com.fasterxml.jackson.annotation.JsonInclude;
import io.sphere.sdk.models.Base;

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

public class ShippingRate extends Base {
    private final MonetaryAmount price;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    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