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

io.sphere.sdk.carts.commands.updateactions.RemoveDiscountCode Maven / Gradle / Ivy

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

import io.sphere.sdk.carts.Cart;
import io.sphere.sdk.commands.UpdateActionImpl;
import io.sphere.sdk.discountcodes.DiscountCode;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.models.Referenceable;

/**
 * Removes a discount code.
 *
 *  {@doc.gen intro}
 *
 * {@include.example io.sphere.sdk.carts.commands.CartUpdateCommandTest#removeDiscountCode()}
 */
public class RemoveDiscountCode extends UpdateActionImpl {
    private final Reference discountCode;

    private RemoveDiscountCode(final Reference discountCode) {
        super("removeDiscountCode");
        this.discountCode = discountCode;
    }

    public static RemoveDiscountCode of(final Referenceable discountCode) {
        return new RemoveDiscountCode(discountCode.toReference());
    }

    public Reference getDiscountCode() {
        return discountCode;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy