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

io.sphere.sdk.carts.commands.updateactions.SetShippingMethod 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.models.Reference;
import io.sphere.sdk.models.Referenceable;
import io.sphere.sdk.shippingmethods.ShippingMethod;

/**
 * Sets the shipping method.
 *
 *  {@doc.gen intro}
 *
 * {@include.example io.sphere.sdk.carts.commands.CartUpdateCommandTest#setShippingMethod()}
 */
public class SetShippingMethod extends UpdateActionImpl {
    private final Reference shippingMethod;

    private SetShippingMethod(final Reference shippingMethod) {
        super("setShippingMethod");
        this.shippingMethod = shippingMethod;
    }

    public Reference getShippingMethod() {
        return shippingMethod;
    }

    public static SetShippingMethod of(final Referenceable shippingMethod) {
        return new SetShippingMethod(shippingMethod.toReference());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy