KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > spi > ejb > PreviousStepPK


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 /*
6  * Generated by XDoclet - Do not edit!
7  */

8 package com.opensymphony.workflow.spi.ejb;
9
10
11 /**
12  * Primary key for CurrentStepPrev.
13  * @author Hani Suleiman (hani@formicary.net) Date: Apr 7, 2003 Time: 8:17:26 PM
14  */

15 public class PreviousStepPK extends java.lang.Object JavaDoc implements java.io.Serializable JavaDoc {
16     //~ Instance fields ////////////////////////////////////////////////////////
17

18     public java.lang.Long JavaDoc id;
19     public java.lang.Long JavaDoc previousId;
20
21     //~ Constructors ///////////////////////////////////////////////////////////
22

23     public PreviousStepPK() {
24     }
25
26     public PreviousStepPK(java.lang.Long JavaDoc id, java.lang.Long JavaDoc previousId) {
27         this.id = id;
28         this.previousId = previousId;
29     }
30
31     //~ Methods ////////////////////////////////////////////////////////////////
32

33     public void setId(java.lang.Long JavaDoc id) {
34         this.id = id;
35     }
36
37     public java.lang.Long JavaDoc getId() {
38         return id;
39     }
40
41     public void setPreviousId(java.lang.Long JavaDoc previousId) {
42         this.previousId = previousId;
43     }
44
45     public java.lang.Long JavaDoc getPreviousId() {
46         return previousId;
47     }
48
49     public boolean equals(Object JavaDoc obj) {
50         if (!(obj instanceof com.opensymphony.workflow.spi.ejb.PreviousStepPK)) {
51             return false;
52         }
53
54         com.opensymphony.workflow.spi.ejb.PreviousStepPK pk = (com.opensymphony.workflow.spi.ejb.PreviousStepPK) obj;
55         boolean eq = true;
56
57         if (obj == null) {
58             eq = false;
59         } else {
60             if ((this.id == null) && (((com.opensymphony.workflow.spi.ejb.PreviousStepPK) obj).getId() == null)) {
61                 eq = true;
62             } else {
63                 if ((this.id == null) || (((com.opensymphony.workflow.spi.ejb.PreviousStepPK) obj).getId() == null)) {
64                     eq = false;
65                 } else {
66                     eq = eq && this.id.equals(pk.id);
67                 }
68             }
69
70             if ((this.previousId == null) && (((com.opensymphony.workflow.spi.ejb.PreviousStepPK) obj).getPreviousId() == null)) {
71                 eq = true;
72             } else {
73                 if ((this.previousId == null) || (((com.opensymphony.workflow.spi.ejb.PreviousStepPK) obj).getPreviousId() == null)) {
74                     eq = false;
75                 } else {
76                     eq = eq && this.previousId.equals(pk.previousId);
77                 }
78             }
79         }
80
81         return eq;
82     }
83
84     public int hashCode() {
85         int hashCode = 0;
86
87         if (this.id != null) {
88             hashCode += this.id.hashCode();
89         }
90
91         if (this.previousId != null) {
92             hashCode += this.previousId.hashCode();
93         }
94
95         return hashCode;
96     }
97
98     /** @return String representation of this pk in the form of [.field1.field2.field3]. */
99     public String JavaDoc toString() {
100         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc("[.");
101         buffer.append(this.id).append('.');
102         buffer.append(this.previousId).append('.');
103         buffer.append(']');
104
105         return buffer.toString();
106     }
107 }
108
Popular Tags