1 package org.qedeq.kernel.se.state;
2
3 import org.qedeq.kernel.se.common.State;
4
5
6
7
8
9
10 public abstract class AbstractState implements State {
11
12
13 private final String text;
14
15
16 private final boolean failure;
17
18
19 private final int code;
20
21
22
23
24
25
26
27
28
29 protected AbstractState(final String text, final boolean failure, final int code) {
30 this.text = text;
31 if (this.text == null) {
32 throw new IllegalArgumentException("text==null");
33 }
34 this.failure = failure;
35 this.code = code;
36 }
37
38 public String getText() {
39 return this.text;
40 }
41
42 public boolean isFailure() {
43 return this.failure;
44 }
45
46 public int getCode() {
47 return this.code;
48 }
49
50 public String toString() {
51 return this.text;
52 }
53
54 public int hashCode() {
55 return this.text.hashCode();
56 }
57
58 public boolean equals(final Object obj) {
59
60 return (this == obj);
61 }
62
63 }