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

io.sphere.client.shop.model.Order Maven / Gradle / Ivy

There is a newer version: 0.72.1
Show newest version
package io.sphere.client.shop.model;

import io.sphere.client.model.Reference;
import org.codehaus.jackson.annotate.JsonProperty;
import org.joda.time.DateTime;

import javax.annotation.Nonnull;
import java.util.Set;

/** An order is the final state of a cart, usually created after a checkout process has been completed. */
public class Order extends LineItemContainer {
    private DateTime completedAt;
    private String orderNumber;
    @Nonnull private OrderState orderState;
    private ShipmentState shipmentState;
    private PaymentState paymentState;
    private Set syncInfo;
    private Reference cart;

    // for JSON deserializer
    protected Order() {}

    /** String that uniquely identifies an order. Optional.
     * It is used to create more human-readable (in contrast to ID) identifier for the order.
     * It is unique within a project. */
    public String getOrderNumber() { return orderNumber; }

    /** Date and time when this order was completed. Optional. */
    public DateTime getCompletedAt() { return completedAt; }

    /** State in which this order is. */
    @Nonnull public OrderState getOrderState() { return orderState; }

    /** State of shipping for this order. Optional. */
    public ShipmentState getShipmentState() { return shipmentState; }

    /** State of the payment for this order. Optional. */
    public PaymentState getPaymentState() { return paymentState; }

    public Set getSyncInfo() {
        return syncInfo;
    }

    public Reference getCart() {
        return cart;
    }

    @Override
    public String toString() {
        return "Order{" +
                "completedAt=" + completedAt +
                ", orderNumber=" + orderNumber +
                ", orderState=" + orderState +
                ", shipmentState=" + shipmentState +
                ", paymentState=" + paymentState +
                ", syncInfo=" + syncInfo +
                ", cart=" + cart +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy