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

io.sphere.sdk.cartdiscounts.AbsoluteCartDiscountValue Maven / Gradle / Ivy

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

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

import javax.money.MonetaryAmount;
import java.util.Collections;
import java.util.List;

/**
 * Cart discount value of an absolute amount.
 *
 * {@include.example io.sphere.sdk.cartdiscounts.commands.CartDiscountUpdateCommandIntegrationTest#changeValue()}
 *
 * @see CartDiscountValue
 * @see CartDiscount#getValue()
 * @see io.sphere.sdk.cartdiscounts.commands.updateactions.ChangeValue
 *
 */
public final class AbsoluteCartDiscountValue extends Base implements CartDiscountValue {
    private final List money;

    @JsonCreator
    private AbsoluteCartDiscountValue(final List money) {
        this.money = money;
    }

    public List getMoney() {
        return money;
    }

    public static AbsoluteCartDiscountValue of(final MonetaryAmount money) {
        return of(Collections.singletonList(money));
    }

    public static AbsoluteCartDiscountValue of(final List money) {
        return new AbsoluteCartDiscountValue(money);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy