io.sphere.sdk.orders.commands.updateactions.ImportLineItemState Maven / Gradle / Ivy
package io.sphere.sdk.orders.commands.updateactions;
import io.sphere.sdk.carts.ItemState;
import io.sphere.sdk.carts.LineItem;
import io.sphere.sdk.commands.UpdateActionImpl;
import io.sphere.sdk.orders.Order;
import java.util.Set;
/**
* These import of states does not follow any predefined rules and should be only used if no transitions are defined.
*
* {@doc.gen intro}
*
* {@include.example io.sphere.sdk.orders.commands.OrderUpdateCommandTest#importLineItemState()}
*/
public class ImportLineItemState extends UpdateActionImpl {
private final String lineItemId;
private final Set state;
private ImportLineItemState(final String lineItemId, final Set state) {
super("importLineItemState");
this.lineItemId = lineItemId;
this.state = state;
}
public String getLineItemId() {
return lineItemId;
}
public Set getState() {
return state;
}
public static ImportLineItemState of(final LineItem lineItem, final Set itemState) {
return of(lineItem.getId(), itemState);
}
public static ImportLineItemState of(final String lineItemId, final Set itemState) {
return new ImportLineItemState(lineItemId, itemState);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy