01: /*
02: * $Id: AssignmentEvent.java 524 2005-09-20 11:16:02Z hengels $
03: * (c) Copyright 2004 con:cern development team.
04: *
05: * This file is part of con:cern (http://concern.org).
06: *
07: * con:cern is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU Lesser General Public License
09: * as published by the Free Software Foundation; either version 2.1
10: * of the License, or (at your option) any later version.
11: *
12: * Please see COPYING for the complete licence.
13: */
14: package org.concern;
15:
16: import java.util.*;
17:
18: /**
19: * @author hengels
20: * @version $Revision: 524 $
21: */
22: public class AssignmentEvent extends EventObject {
23: String process;
24: String activity;
25: String subjectId;
26: String assignee;
27: int level;
28:
29: public AssignmentEvent(Object source, String process,
30: String activity, String subjectId, String assignee,
31: int level) {
32: super (source);
33: this .process = process;
34: this .activity = activity;
35: this .subjectId = subjectId;
36: this .assignee = assignee;
37: this .level = level;
38: }
39:
40: public String getProcess() {
41: return process;
42: }
43:
44: public String getActivity() {
45: return activity;
46: }
47:
48: public String getSubjectId() {
49: return subjectId;
50: }
51:
52: public String getAssignee() {
53: return assignee;
54: }
55:
56: public int getLevel() {
57: return level;
58: }
59:
60: public boolean equals(Object o) {
61: if (this == o)
62: return true;
63: if (o == null || getClass() != o.getClass())
64: return false;
65:
66: final AssignmentEvent event = (AssignmentEvent) o;
67:
68: if (level != event.level)
69: return false;
70: if (!activity.equals(event.activity))
71: return false;
72: if (!assignee.equals(event.assignee))
73: return false;
74: if (!process.equals(event.process))
75: return false;
76: if (!subjectId.equals(event.subjectId))
77: return false;
78:
79: return true;
80: }
81:
82: public int hashCode() {
83: int result;
84: result = process.hashCode();
85: result = 29 * result + activity.hashCode();
86: result = 29 * result + subjectId.hashCode();
87: result = 29 * result + assignee.hashCode();
88: result = 29 * result + level;
89: return result;
90: }
91:
92: public String toString() {
93: return process + ":" + activity + ":" + subjectId + " -> "
94: + assignee;
95: }
96: }
|