io.sphere.sdk.carts.commands.updateactions.SetShippingMethod Maven / Gradle / Ivy
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());
}
}