com.logicommerce.sdk.builders.order.OrderItemPricesBuilder 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.models.order.OrderItemPrices;
import com.logicommerce.sdk.models.order.implementations.OrderItemPricesImpl;
/**
* OrderItemPricesBuilder class.
*
* @author Logicommerce
* @since 1.0.16
*/
public class OrderItemPricesBuilder {
private T parentBuilder;
protected double productPrice;
protected double optionsPrice;
protected double previousPrice;
protected double price;
protected double totalTaxes;
protected double total;
/**
* Constructor for OrderItemPricesBuilder.
*/
public OrderItemPricesBuilder() {
}
/**
* Constructor for OrderItemPricesBuilder.
*
* @param parentBuilder a T object
*/
public OrderItemPricesBuilder(T parentBuilder) {
this();
this.parentBuilder = parentBuilder;
}
/**
* productPrice.
*
* @param productPrice a double
* @return a {@link com.logicommerce.sdk.builders.order.OrderItemPricesBuilder} object
*/
public OrderItemPricesBuilder productPrice(double productPrice) {
this.productPrice = productPrice;
return this;
}
/**
* optionsPrice.
*
* @param optionsPrice a double
* @return a {@link com.logicommerce.sdk.builders.order.OrderItemPricesBuilder} object
*/
public OrderItemPricesBuilder optionsPrice(double optionsPrice) {
this.optionsPrice = optionsPrice;
return this;
}
/**
* previousPrice.
*
* @param previousPrice a double
* @return a {@link com.logicommerce.sdk.builders.order.OrderItemPricesBuilder} object
*/
public OrderItemPricesBuilder previousPrice(double previousPrice) {
this.previousPrice = previousPrice;
return this;
}
/**
* price.
*
* @param price a double
* @return a {@link com.logicommerce.sdk.builders.order.OrderItemPricesBuilder} object
*/
public OrderItemPricesBuilder price(double price) {
this.price = price;
return this;
}
/**
* totalTaxes.
*
* @param totalTaxes a double
* @return a {@link com.logicommerce.sdk.builders.order.OrderItemPricesBuilder} object
*/
public OrderItemPricesBuilder totalTaxes(double totalTaxes) {
this.totalTaxes = totalTaxes;
return this;
}
/**
* total.
*
* @param total a double
* @return a {@link com.logicommerce.sdk.builders.order.OrderItemPricesBuilder} object
*/
public OrderItemPricesBuilder total(double total) {
this.total = total;
return this;
}
/**
* build.
*
* @return a {@link com.logicommerce.sdk.models.order.OrderItemPrices} object
*/
public OrderItemPrices build() {
OrderItemPricesImpl prices = new OrderItemPricesImpl();
prices.setProductPrice(productPrice);
prices.setOptionsPrice(optionsPrice);
prices.setPreviousPrice(previousPrice);
prices.setPrice(price);
prices.setTotalTaxes(totalTaxes);
prices.setTotal(total);
return prices;
}
/**
* done.
*
* @return a T object
*/
public T done() {
return parentBuilder;
}
}