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

io.sphere.sdk.products.commands.updateactions.AddPrice Maven / Gradle / Ivy

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

import io.sphere.sdk.commands.UpdateActionImpl;
import io.sphere.sdk.products.Price;
import io.sphere.sdk.products.Product;

/**
 * Adds the given price to the product variant's prices set. It is rejected if the product already contains a price with the same price scope (same currency, country, customer group and channel).
 *
 * {@doc.gen intro}
 *
 * {@include.example io.sphere.sdk.products.commands.ProductUpdateCommandTest#addPrice()}
 */
public class AddPrice extends UpdateActionImpl {
    private final Integer variantId;
    private final Price price;


    private AddPrice(final Integer variantId, final Price price) {
        super("addPrice");
        this.variantId = variantId;
        this.price = price;
    }

    public Integer getVariantId() {
        return variantId;
    }

    public Price getPrice() {
        return price;
    }

    public static AddPrice of(final Integer variantId, final Price price) {
        return new AddPrice(variantId, price);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy