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

io.sphere.sdk.orders.OrderFromCartDraft Maven / Gradle / Ivy

There is a newer version: 2.16.0
Show newest version
package io.sphere.sdk.orders;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.sphere.sdk.carts.Cart;
import io.sphere.sdk.models.Versioned;

import javax.annotation.Nullable;

@JsonDeserialize(as = OrderFromCartDraftImpl.class)
public interface OrderFromCartDraft {
    String getId();

    Long getVersion();

    @Nullable
    String getOrderNumber();

    @Nullable
    PaymentState getPaymentState();

    static OrderFromCartDraft of(final Versioned cart, @Nullable final String orderNumber, @Nullable final PaymentState paymentState) {
        return new OrderFromCartDraftImpl(cart.getId(), cart.getVersion(), orderNumber, paymentState);
    }

    static OrderFromCartDraft of(final Versioned cart) {
        return new OrderFromCartDraftImpl(cart.getId(), cart.getVersion(), null, null);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy