01: package org.drools;
02:
03: public class Alarm {
04: private String message;
05:
06: public Alarm() {
07:
08: }
09:
10: public Alarm(final String message) {
11: this .message = message;
12: }
13:
14: public String toString() {
15: return "[Alarm message=" + this .message + "]";
16: }
17:
18: /**
19: * @inheritDoc
20: */
21: public int hashCode() {
22: final int PRIME = 31;
23: int result = 1;
24: result = PRIME
25: * result
26: + ((this .message == null) ? 0 : this .message.hashCode());
27: return result;
28: }
29:
30: /**
31: * @inheritDoc
32: */
33: public boolean equals(final Object obj) {
34: if (this == obj) {
35: return true;
36: }
37: if (obj == null) {
38: return false;
39: }
40: if (getClass() != obj.getClass()) {
41: return false;
42: }
43: final Alarm other = (Alarm) obj;
44: if (this .message == null) {
45: if (other.message != null) {
46: return false;
47: }
48: } else if (!this .message.equals(other.message)) {
49: return false;
50: }
51: return true;
52: }
53:
54: /**
55: * @return the message
56: */
57: public String getMessage() {
58: return this .message;
59: }
60:
61: /**
62: * @param message the message to set
63: */
64: public void setMessage(final String message) {
65: this.message = message;
66: }
67:
68: }
|