View Javadoc

1   /*
2    *  author nambi sankaran
3    *  copyright (C) 2009 nambi sankaran.
4    *
5    *  This program is free software: you can redistribute it and/or modify
6    *  it under the terms of the GNU General Public License as published by
7    *  the Free Software Foundation, either version 3 of the License, or
8    *  (at your option) any later version.
9    *
10   *  This program is distributed in the hope that it will be useful,
11   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   *  GNU General Public License for more details.
14   *
15   *  You should have received a copy of the GNU General Public License
16   *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17   *
18   */
19  package net.sf.emarket.account.domain;
20  
21  import java.sql.Timestamp;
22  
23  public class AcctPositionTransfer {
24  
25  	private long transferId =0l;
26  	private long fillId = 0l;
27  	private String senderAcctId = null;
28  	private String receiverAcctId = null;
29  	private String symbol = null;
30  	private int quantity = 0;
31      private float price = 0f;
32      private String type = null;
33  	private Timestamp createdTime = null;
34  	private String transferStatus =null;
35  	private Timestamp timestamp = null;
36  	
37  	public long getTransferId() {
38  		return transferId;
39  	}
40  	public void setTransferId(long transferId) {
41  		this.transferId = transferId;
42  	}
43  	public String getSenderAcctId() {
44  		return senderAcctId;
45  	}
46  	public void setSenderAcctId(String senderAcctId) {
47  		this.senderAcctId = senderAcctId;
48  	}
49  	public String getReceiverAcctId() {
50  		return receiverAcctId;
51  	}
52  	public void setReceiverAcctId(String receiverAcctId) {
53  		this.receiverAcctId = receiverAcctId;
54  	}
55  	public String getSymbol() {
56  		return symbol;
57  	}
58  	public void setSymbol(String symbol) {
59  		this.symbol = symbol;
60  	}
61  	public int getQuantity() {
62  		return quantity;
63  	}
64  	public void setQuantity(int quantity) {
65  		this.quantity = quantity;
66  	}
67      public float getPrice(){
68          return price;
69      }
70      public void setPrice( float p){
71          price = p;        
72      }
73      public String getType(){
74          return type;
75      }
76      public void setType( String t){
77          type = t;
78      }
79  	public Timestamp getCreatedTime() {
80  		return createdTime;
81  	}
82  	public void setCreatedTime(Timestamp createdTime) {
83  		this.createdTime = createdTime;
84  	}
85  	public String getTransferStatus() {
86  		return transferStatus;
87  	}
88  	public void setTransferStatus(String transferStatus) {
89  		this.transferStatus = transferStatus;
90  	}
91  	public Timestamp getTimestamp() {
92  		return timestamp;
93  	}
94  	public void setTimestamp(Timestamp timestamp) {
95  		this.timestamp = timestamp;
96  	}
97  	
98  	@Override
99  	public int hashCode() {
100 		final int prime = 31;
101 		int result = 1;
102 		result = prime * result
103 				+ ((createdTime == null) ? 0 : createdTime.hashCode());
104 		result = prime * result + quantity;
105 		result = prime * result
106 				+ ((receiverAcctId == null) ? 0 : receiverAcctId.hashCode());
107 		result = prime * result
108 				+ ((senderAcctId == null) ? 0 : senderAcctId.hashCode());
109 		result = prime * result + ((symbol == null) ? 0 : symbol.hashCode());
110 		result = prime * result
111 				+ ((timestamp == null) ? 0 : timestamp.hashCode());
112 		result = prime * result + (int) (transferId ^ (transferId >>> 32));
113 		result = prime * result
114 				+ ((transferStatus == null) ? 0 : transferStatus.hashCode());
115 		return result;
116 	}
117 	
118 	@Override
119 	public boolean equals(Object obj) {
120 		if (this == obj)
121 			return true;
122 		if (obj == null)
123 			return false;
124 		if (getClass() != obj.getClass())
125 			return false;
126 		AcctPositionTransfer other = (AcctPositionTransfer) obj;
127 		if (createdTime == null) {
128 			if (other.createdTime != null)
129 				return false;
130 		} else if (!createdTime.equals(other.createdTime))
131 			return false;
132 		if (quantity != other.quantity)
133 			return false;
134 		if (receiverAcctId == null) {
135 			if (other.receiverAcctId != null)
136 				return false;
137 		} else if (!receiverAcctId.equals(other.receiverAcctId))
138 			return false;
139 		if (senderAcctId == null) {
140 			if (other.senderAcctId != null)
141 				return false;
142 		} else if (!senderAcctId.equals(other.senderAcctId))
143 			return false;
144 		if (symbol == null) {
145 			if (other.symbol != null)
146 				return false;
147 		} else if (!symbol.equals(other.symbol))
148 			return false;
149 		if (timestamp == null) {
150 			if (other.timestamp != null)
151 				return false;
152 		} else if (!timestamp.equals(other.timestamp))
153 			return false;
154 		if (transferId != other.transferId)
155 			return false;
156 		if (transferStatus == null) {
157 			if (other.transferStatus != null)
158 				return false;
159 		} else if (!transferStatus.equals(other.transferStatus))
160 			return false;
161 		return true;
162 	}
163 }