KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > interfaces > AccountPK


1 /*
2  * Generated by XDoclet - Do not edit!
3  */

4 package test.interfaces;
5
6 /**
7  * Primary key for Account.
8  * @xdoclet-generated at 16-04-05
9  * @copyright The XDoclet Team
10  * @author XDoclet
11  * @version 1.2.3
12  */

13 public class AccountPK
14    extends java.lang.Object JavaDoc
15    implements java.io.Serializable JavaDoc
16 {
17
18    public java.lang.Integer JavaDoc id;
19
20    public AccountPK()
21    {
22    }
23
24    public AccountPK( java.lang.Integer JavaDoc id )
25    {
26       this.id = id;
27    }
28
29    public java.lang.Integer JavaDoc getId()
30    {
31       return id;
32    }
33
34    public void setId(java.lang.Integer JavaDoc id)
35    {
36       this.id = id;
37    }
38
39    public int hashCode()
40    {
41       int _hashCode = 0;
42          if (this.id != null) _hashCode += this.id.hashCode();
43
44       return _hashCode;
45    }
46
47    public boolean equals(Object JavaDoc obj)
48    {
49       if( !(obj instanceof test.interfaces.AccountPK) )
50          return false;
51
52       test.interfaces.AccountPK pk = (test.interfaces.AccountPK)obj;
53       boolean eq = true;
54
55       if( obj == null )
56       {
57          eq = false;
58       }
59       else
60       {
61          if( this.id != null )
62          {
63             eq = eq && this.id.equals( pk.getId() );
64          }
65          else // this.id == null
66
{
67             eq = eq && ( pk.getId() == null );
68          }
69       }
70
71       return eq;
72    }
73
74    /** @return String representation of this pk in the form of [.field1.field2.field3]. */
75    public String JavaDoc toString()
76    {
77       StringBuffer JavaDoc toStringValue = new StringBuffer JavaDoc("[.");
78          toStringValue.append(this.id).append('.');
79       toStringValue.append(']');
80       return toStringValue.toString();
81    }
82
83 }
84
Popular Tags