io.sphere.sdk.shippingmethods.ShippingRate Maven / Gradle / Ivy
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