io.sphere.sdk.cartdiscounts.DiscountedLineItemPortion Maven / Gradle / Ivy
package io.sphere.sdk.cartdiscounts;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.models.Referenceable;
import javax.money.MonetaryAmount;
public class DiscountedLineItemPortion extends Base {
private final Reference discount;
private final MonetaryAmount discountedAmount;
@JsonCreator
private DiscountedLineItemPortion(final Reference discount, final MonetaryAmount discountedAmount) {
this.discount = discount;
this.discountedAmount = discountedAmount;
}
public static DiscountedLineItemPortion of(final Referenceable discount, final MonetaryAmount discountedAmount) {
return new DiscountedLineItemPortion(discount.toReference(), discountedAmount);
}
public Reference getDiscount() {
return discount;
}
public MonetaryAmount getDiscountedAmount() {
return discountedAmount;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy