lineitem.java
来自「网上商店 新增功能: 1」· Java 代码 · 共 71 行
JAVA
71 行
package netstore.businessobjects;
import java.io.Serializable;
import org.apache.commons.lang.builder.ToStringBuilder;
public class LineItem implements Serializable {
private int quantity;
private double basePrice;
private Order order;
private Item item;
public LineItem(int quantity, double basePrice, Order order, Item item) {
this.quantity = quantity;
this.basePrice = basePrice;
this.order = order;
this.item = item;
}
public LineItem() {
}
public LineItem(int quantity, double basePrice, netstore.businessobjects.Item item) {
this.quantity = quantity;
this.basePrice = basePrice;
this.item = item;
}
public int getQuantity() {
return this.quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public double getBasePrice() {
return this.basePrice;
}
public void setBasePrice(double basePrice) {
this.basePrice = basePrice;
}
public double getUnitPrice(){
return basePrice*quantity;
}
public Order getOrder() {
return this.order;
}
public void setOrder(Order order) {
this.order = order;
}
public Item getItem() {
return this.item;
}
public void setItem(Item item) {
this.item = item;
}
public String toString() {
return new ToStringBuilder(this)
.toString();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?