com.logicommerce.sdk.builders.order.OrderSdkBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk Show documentation
Show all versions of sdk Show documentation
SDK for developing Logicommerce plugins.
package com.logicommerce.sdk.builders.order;
import com.logicommerce.sdk.enums.OrderStatusType;
import com.logicommerce.sdk.models.order.Order;
import com.logicommerce.sdk.models.order.implementations.OrderImpl;
/**
* OrderSdkBuilder class.
*
* @author Logicommerce
* @since 1.0.16
*/
public class OrderSdkBuilder extends DocumentSdkBuilder {
protected OrderStatusType status;
protected int substatusId;
/**
* Constructor for OrderSdkBuilder.
*/
public OrderSdkBuilder() {
status = OrderStatusType.INCIDENTS;
}
/**
* status.
*
* @param status a {@link com.logicommerce.sdk.enums.OrderStatusType} object
* @return a {@link com.logicommerce.sdk.builders.order.OrderSdkBuilder} object
*/
public OrderSdkBuilder status(OrderStatusType status) {
this.status = status;
return returnThis();
}
/**
* substatusId.
*
* @param substatusId a int
* @return a {@link com.logicommerce.sdk.builders.order.OrderSdkBuilder} object
*/
public OrderSdkBuilder substatusId(int substatusId) {
this.substatusId = substatusId;
return returnThis();
}
/**
* build.
*
* @return a {@link com.logicommerce.sdk.models.order.Order} object
*/
public Order build() {
OrderImpl order = new OrderImpl();
setFields(order);
order.setStatus(status);
order.setSubstatusId(substatusId);
return order;
}
@Override
public OrderSdkBuilder returnThis() {
return this;
}
}