View Javadoc

1   /*
2    *  
3    *  author nambi sankaran
4    *  copyright (C) 2009 nambi sankaran.
5    *
6    *  This program is free software: you can redistribute it and/or modify
7    *  it under the terms of the GNU General Public License as published by
8    *  the Free Software Foundation, either version 3 of the License, or
9    *  (at your option) any later version.
10   *
11   *  This program is distributed in the hope that it will be useful,
12   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   *  GNU General Public License for more details.
15   *
16   *  You should have received a copy of the GNU General Public License
17   *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18   *
19   */
20  package net.sf.emarket.quote.domain;
21  
22  import java.io.Serializable;
23  import java.sql.Timestamp;
24  
25  import javax.persistence.Entity;
26  
27  @Entity
28  public class Instrument implements Serializable{
29  
30  	private static final long serialVersionUID = 2199980212558657684L;
31  
32      public static final String STATUS_ACTIVE = "ACTIVE";
33      public static final String STATUS_STOPPED = "STOPPED";
34      public static final String STATUS_NEW = "NEW";
35  
36  
37  	private String symbol=null;
38  	private String type = null;
39  	private String exchange = null;
40  	private String description = null;
41  	private String exchangeType = null;
42      private String status = null;
43  	private Timestamp time = null;
44  	
45  	public String getSymbol() {
46  		return symbol;
47  	}
48  
49  
50      @Override
51      public int hashCode() {
52          int result = symbol != null ? symbol.hashCode() : 0;
53          result = 31 * result + (type != null ? type.hashCode() : 0);
54          result = 31 * result + (exchange != null ? exchange.hashCode() : 0);
55          result = 31 * result + (description != null ? description.hashCode() : 0);
56          result = 31 * result + (exchangeType != null ? exchangeType.hashCode() : 0);
57          result = 31 * result + (status != null ? status.hashCode() : 0);
58          result = 31 * result + (time != null ? time.hashCode() : 0);
59          return result;
60      }
61  
62      public void setSymbol(String symbol) {
63  		this.symbol = symbol;
64  
65  	}
66  	public String getType() {
67  		return type;
68  	}
69  	public void setType(String type) {
70  		this.type = type;
71  	}
72  	public String getExchange() {
73  		return exchange;
74  	}
75  	public void setExchange(String exchange) {
76  		this.exchange = exchange;
77  	}
78  	public String getDescription() {
79  		return description;
80  	}
81  	public void setDescription(String description) {
82  		this.description = description;
83  	}
84  	public String getExchangeType() {
85  		return exchangeType;
86  	}
87  	public void setExchangeType(String exchangeType) {
88  		this.exchangeType = exchangeType;
89  	}
90      public String getStatus() {
91          return status;
92      }
93      public void setStatus(String status) {
94          this.status = status;
95      }
96  	public Timestamp getTime() {
97  		return time;
98  	}
99  	public void setTime(Timestamp time) {
100 		this.time = time;
101 	}
102 
103     @Override
104     public boolean equals(Object o) {
105         if (this == o) return true;
106         if (o == null || getClass() != o.getClass()) return false;
107 
108         Instrument that = (Instrument) o;
109 
110         if (symbol != null ? !symbol.equals(that.symbol) : that.symbol != null) return false;
111 
112         return true;
113     }
114     
115 }