KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > xml > multispaced > pm > jdbc > JDBCPm


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.test.xml.multispaced.pm.jdbc;
8
9 /**
10  * @version <tt>$Revision: 1.1 $</tt>
11  * @author <a HREF="mailto:alex@jboss.org">Alexey Loubyansky</a>
12  */

13 public class JDBCPm
14 {
15    private String JavaDoc datasource;
16    private String JavaDoc table;
17
18    public String JavaDoc getDatasource()
19    {
20       return datasource;
21    }
22
23    public void setDatasource(String JavaDoc datasource)
24    {
25       this.datasource = datasource;
26    }
27
28    public String JavaDoc getTable()
29    {
30       return table;
31    }
32
33    public void setTable(String JavaDoc table)
34    {
35       this.table = table;
36    }
37
38    public String JavaDoc toString()
39    {
40       return "[datasource=" + datasource + ", table=" + table + ']';
41    }
42
43    public boolean equals(Object JavaDoc o)
44    {
45       if(this == o) return true;
46       if(!(o instanceof JDBCPm)) return false;
47
48       final JDBCPm jdbcPm = (JDBCPm)o;
49
50       if(datasource != null ? !datasource.equals(jdbcPm.datasource) : jdbcPm.datasource != null) return false;
51       if(table != null ? !table.equals(jdbcPm.table) : jdbcPm.table != null) return false;
52
53       return true;
54    }
55
56    public int hashCode()
57    {
58       int result;
59       result = (datasource != null ? datasource.hashCode() : 0);
60       result = 29 * result + (table != null ? table.hashCode() : 0);
61       return result;
62    }
63 }
64
Popular Tags