package io.pivotal.web.domain;
import java.math.BigDecimal;
import java.util.Date;
public class Order {
private Integer orderId;
private String accountId;
private String symbol;
private BigDecimal orderFee;
private Date completionDate;
private OrderType orderType;
private BigDecimal price;
private Integer quantity;
public Integer getOrderId() {
return orderId;
}
public void setOrderId(Integer orderId) {
this.orderId = orderId;
}
public String getAccountId() {
return accountId;
}
public void setAccountId(String accountId) {
this.accountId = accountId;
}
public String getSymbol() {
return symbol;
}
public void setSymbol(String symbol) {
this.symbol = symbol;
}
public BigDecimal getOrderFee() {
return orderFee;
}
public void setOrderFee(BigDecimal orderFee) {
this.orderFee = orderFee;
}
public Date getCompletionDate() {
return completionDate;
}
public void setCompletionDate(Date completionDate) {
this.completionDate = completionDate;
}
public OrderType getOrderType() {
return orderType;
}
public void setOrderType(OrderType orderType) {
this.orderType = orderType;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public Integer getQuantity() {
return quantity;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("Order [orderId=").append(orderId)
.append(", accountId=").append(accountId).append(", symbol=")
.append(symbol).append(", orderFee=").append(orderFee)
.append(", completionDate=").append(completionDate)
.append(", orderType=").append(orderType).append(", price=")
.append(price).append(", quantity=").append(quantity)
.append("]");
return builder.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((accountId == null) ? 0 : accountId.hashCode());
result = prime * result
+ ((completionDate == null) ? 0 : completionDate.hashCode());
result = prime * result
+ ((orderFee == null) ? 0 : orderFee.hashCode());
result = prime * result + ((orderId == null) ? 0 : orderId.hashCode());
result = prime * result
+ ((orderType == null) ? 0 : orderType.hashCode());
result = prime * result + ((price == null) ? 0 : price.hashCode());
result = prime * result
+ ((quantity == null) ? 0 : quantity.hashCode());
result = prime * result + ((symbol == null) ? 0 : symbol.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Order other = (Order) obj;
if (accountId == null) {
if (other.accountId != null)
return false;
} else if (!accountId.equals(other.accountId))
return false;
if (completionDate == null) {
if (other.completionDate != null)
return false;
} else if (!completionDate.equals(other.completionDate))
return false;
if (orderFee == null) {
if (other.orderFee != null)
return false;
} else if (!orderFee.equals(other.orderFee))
return false;
if (orderId == null) {
if (other.orderId != null)
return false;
} else if (!orderId.equals(other.orderId))
return false;
if (orderType != other.orderType)
return false;
if (price == null) {
if (other.price != null)
return false;
} else if (!price.equals(other.price))
return false;
if (quantity == null) {
if (other.quantity != null)
return false;
} else if (!quantity.equals(other.quantity))
return false;
if (symbol == null) {
if (other.symbol != null)
return false;
} else if (!symbol.equals(other.symbol))
return false;
return true;
}
}