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-M26
Show newest version
package io.sphere.sdk.shippingmethods;

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

import javax.annotation.Nullable;
import javax.money.MonetaryAmount;

public class ShippingRate extends Base {
    private final MonetaryAmount price;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @Nullable
    private final MonetaryAmount freeAbove;

    @JsonCreator
    private ShippingRate(final MonetaryAmount price, @Nullable final MonetaryAmount freeAbove) {
        this.price = price;
        this.freeAbove = freeAbove;
    }

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

    public static ShippingRate of(final MonetaryAmount price) {
        return of(price, null);
    }

    public MonetaryAmount getPrice() {
        return price;
    }

    @Nullable
    public MonetaryAmount getFreeAbove() {
        return freeAbove;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy