📄 tradedetailsinfo.java
字号:
/*
* @author : Pushkala
* @version : 1.0
*
* Development Environment : Oracle9i JDeveloper
*
* Name of the File : TradeDetailsInfo.java
*
* Creation / Modification History
* Pushkala 26-Apr-2002 Created
*
*/
package oracle.otnsamples.ibfbs.trademanagement.ejb;
import java.util.Date;
import java.io.Serializable;
/**
* This Class encapsulates TradeDetails Information for a User Account.
* Whenever the session facade bean TradeManagementSessionFacadeBean needs to
* query or add Trade Details Info for a particular User Account, it is passed
* as TradeDetailsInfo value object. Thus this class acts as Value object while
* getting/setting trade details information between Session Facade Bean and
* TradeDetails Entity Bean.
*
* @version 1.0
* @since 1.0
*/
public class TradeDetailsInfo implements Serializable {
// Declaring instance variables required to store the TradeDetails information
/** Trade Id */
private Integer tradeId;
/** Action */
private String action;
/** Quantity */
private Integer quantity;
/** Trade Date */
private Date tradeDate;
/** Stock Price */
private float price;
/** Stock Symbol */
private String symbol;
/** Order Type */
private String orderType;
/** Status */
private String status;
/** Exchange Id */
private Integer exchangeId;
/**
* Empty Default constructor
* @since 1.0
*/
public TradeDetailsInfo() {}
/**
* This constructor sets the instance variables with the input values
*
* @param tradeId Trade Id
* @param action Action
* Valid Values are
* 'B' for 'Buy,
* 'S' for 'Sell',
* 'T' for 'Transfer'
* @param quantity Quantity
* @param tradeDate Trade Date
* @param price Price
* @param symbol Symbol
* @param orderType Order Type
* Valid Values are
* 'M' for 'Market Order',
* 'L' for 'Limit Order',
* 'D' for 'Day Order'
* @param status Status of the order
* Valid Values are
* 'R' for 'Requested' when market is closed,
* 'Q' for 'Queued' when order is in queue,
* 'O' for 'Ordered' when the acknowledgement is received for order,
* 'E' for 'Executed' when the order is executed,
* 'P' for 'PartExecuted' when the order is part executed,
* 'X' for 'Rejected' by Exchange,
* 'C' for 'Cancelled' by User
* @param exchangeId Exchange Id
* @since 1.0
*/
public TradeDetailsInfo(Integer tradeId, String action, Integer quantity,
Date tradeDate, float price, String symbol,
String orderType, String status, Integer exchangeId) {
setTradeId(tradeId);
setAction(action);
setQuantity(quantity);
setTradeDate(tradeDate);
setPrice(price);
setSymbol(symbol);
setOrderType(orderType);
setStatus(status);
setExchangeId(exchangeId);
}
/**
* Returns the Trade Id
*
* @return The Trade Id
* @since 1.0
*/
public Integer getTradeId() {
return tradeId;
}
/**
* Sets the Trade Id
*
* @param tradeId Trade Id
* @since 1.0
*/
private void setTradeId(Integer tradeId) {
this.tradeId = tradeId;
}
/**
* Returns the Action
*
* @return The Action associated with the Trade
* @since 1.0
*/
public String getAction() {
return action;
}
/**
* Sets the Action
*
* @param action Action
* @since 1.0
*/
private void setAction(String action) {
this.action = action;
}
/**
* Returns the quantity
*
* @return The Trade Quantity
* @since 1.0
*/
public Integer getQuantity() {
return quantity;
}
/**
* Sets the quantity
*
* @param quantity quantity
* @since 1.0
*/
private void setQuantity(Integer quantity) {
this.quantity = quantity;
}
/**
* Returns the Date on which the Trade was carried out
*
* @return The Trade Date
* @since 1.0
*/
public Date getTradeDate() {
return tradeDate;
}
/**
* Sets the Date on which the trading took place
*
* @param tradeDate Trade Date
* @since 1.0
*/
private void setTradeDate(Date tradeDate) {
this.tradeDate = tradeDate;
}
/**
* Returns the price at which the trade was carried out
*
* @return The Stock Price at the time of trade
* @since 1.0
*/
public float getPrice() {
return price;
}
/**
* Sets the price at which the trade was carried out
*
* @param price Price
* @since 1.0
*/
private void setPrice(float price) {
this.price = price;
}
/**
* Returns the Stock symbol
*
* @return The Stock Symbol
* @since 1.0
*/
public String getSymbol() {
return symbol;
}
/**
* Sets the stock symbol
*
* @param symbol Stock Symbol
* @since 1.0
*/
private void setSymbol(String symbol) {
this.symbol = symbol;
}
/**
* Returns the Order Type
*
* @return The Order Type
* @since 1.0
*/
public String getOrderType() {
return orderType;
}
/**
* Sets the Order Type
*
* @param orderType Order Type
* @since 1.0
*/
private void setOrderType(String orderType) {
this.orderType = orderType;
}
/**
* Returns the status of the trade
*
* @return The Status of the Trade
* @since 1.0
*/
public String getStatus() {
return status;
}
/**
* Sets the status of the trade
*
* @param status Status
* @since 1.0
*/
private void setStatus(String status) {
this.status = status;
}
/**
* Returns the exchange id
*
* @return The Exchange Id
* @since 1.0
*/
public Integer getExchangeId() {
return exchangeId;
}
/**
* Sets the Exchange Id
*
* @param exchangeId Exchange Id
* @since 1.0
*/
private void setExchangeId(Integer exchangeId) {
this.exchangeId = exchangeId;
}
/**
* Method to get String representation of this class.
* Overrides the method toString() in java.lang.Object
*
* @return String representation of this class.
* @since 1.0
*/
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("Trade Id :" ).append(this.getTradeId());
sb.append(" Action :" ).append(this.getAction());
sb.append(" Quantity :" ).append(this.getQuantity());
sb.append(" Trade Date :" ).append(this.getTradeDate());
sb.append(" Price :" ).append(this.getPrice());
sb.append(" Symbol :" ).append(this.getSymbol());
sb.append(" Order Type :" ).append(this.getOrderType());
sb.append(" Status :" ).append(this.getStatus());
sb.append(" Exchange Id :").append(this.getExchangeId());
return sb.toString();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -