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

io.sphere.sdk.discountcodes.commands.updateactions.ChangeCartDiscounts Maven / Gradle / Ivy

There is a newer version: 1.0.0-M26
Show newest version
package io.sphere.sdk.discountcodes.commands.updateactions;

import io.sphere.sdk.cartdiscounts.CartDiscount;
import io.sphere.sdk.commands.UpdateActionImpl;
import io.sphere.sdk.discountcodes.DiscountCode;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.models.Referenceable;

import java.util.Collections;
import java.util.List;

/**
 * Changes the cart discounts.
 *
 * {@doc.gen intro}
 *
 * {@include.example io.sphere.sdk.discountcodes.commands.DiscountCodeUpdateCommandTest#changeCartDiscounts()}
 */
public class ChangeCartDiscounts extends UpdateActionImpl {
    private final List> cartDiscounts;

    private ChangeCartDiscounts(final List> cartDiscounts) {
        super("changeCartDiscounts");
        this.cartDiscounts = cartDiscounts;
    }

    public static ChangeCartDiscounts of(final Referenceable cartDiscount) {
        return of(Collections.singletonList(cartDiscount.toReference()));
    }

    public static ChangeCartDiscounts of(final List> cartDiscounts) {
        return new ChangeCartDiscounts(cartDiscounts);
    }


    public List> getCartDiscounts() {
        return cartDiscounts;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy