com.logicommerce.sdk.builders.order.OrderShipmentItemBuilder 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.
The newest version!
package com.logicommerce.sdk.builders.order;
import com.logicommerce.sdk.models.order.OrderShipmentItem;
import com.logicommerce.sdk.models.order.implementations.OrderShipmentItemImpl;
/**
* OrderShipmentItemBuilder class.
*
* @author Logicommerce
* @since 1.0.16
*/
public class OrderShipmentItemBuilder {
private T parentBuilder;
private int quantity;
private Integer orderItemId;
private double weight;
/**
* Constructor for OrderShipmentItemBuilder.
*/
public OrderShipmentItemBuilder() {
}
/**
* Constructor for OrderShipmentItemBuilder.
*
* @param parentBuilder a T object
*/
public OrderShipmentItemBuilder(T parentBuilder) {
this();
this.parentBuilder = parentBuilder;
}
/**
* quantity.
*
* @param quantity a int
* @return a {@link com.logicommerce.sdk.builders.order.OrderShipmentItemBuilder} object
*/
public OrderShipmentItemBuilder quantity(int quantity) {
this.quantity = quantity;
return this;
}
/**
* orderItemId.
*
* @param orderItemId a {@link java.lang.Integer} object
* @return a {@link com.logicommerce.sdk.builders.order.OrderShipmentItemBuilder} object
*/
public OrderShipmentItemBuilder orderItemId(Integer orderItemId) {
this.orderItemId = orderItemId;
return this;
}
/**
* weight.
*
* @param weight a double
* @return a {@link com.logicommerce.sdk.builders.order.OrderShipmentItemBuilder} object
*/
public OrderShipmentItemBuilder weight(double weight) {
this.weight = weight;
return this;
}
/**
* build.
*
* @return a {@link com.logicommerce.sdk.models.order.OrderShipmentItem} object
*/
public OrderShipmentItem build() {
OrderShipmentItemImpl item = new OrderShipmentItemImpl();
item.setId(null);
item.setQuantity(quantity);
item.setOrderItemId(orderItemId);
item.setWeight(weight);
return item;
}
/**
* done.
*
* @return a T object
*/
public T done() {
return parentBuilder;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy