|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| |
|
18 |
| package org.qedeq.kernel.bo.module; |
|
19 |
| |
|
20 |
| |
|
21 |
| |
|
22 |
| |
|
23 |
| |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
| public final class LogicalState { |
|
28 |
| |
|
29 |
| |
|
30 |
| public static final LogicalState STATE_UNCHECKED |
|
31 |
| = new LogicalState(LogicalStateDescriptions.STATE_STRING_UNCHECKED, |
|
32 |
| false, LogicalStateDescriptions.STATE_CODE_UNCHECKED); |
|
33 |
| |
|
34 |
| |
|
35 |
| public static final LogicalState STATE_EXTERNAL_CHECKING |
|
36 |
| = new LogicalState(LogicalStateDescriptions.STATE_STRING_EXTERNAL_CHECKING, |
|
37 |
| false, LogicalStateDescriptions.STATE_CODE_EXTERNAL_CHECKING); |
|
38 |
| |
|
39 |
| |
|
40 |
| public static final LogicalState STATE_EXTERNAL_CHECK_FAILED |
|
41 |
| = new LogicalState(LogicalStateDescriptions.STATE_STRING_EXTERNAL_CHECK_FAILED, |
|
42 |
| true, LogicalStateDescriptions.STATE_CODE_EXTERNAL_CHECK_FAILED); |
|
43 |
| |
|
44 |
| |
|
45 |
| public static final LogicalState STATE_INTERNAL_CHECKING |
|
46 |
| = new LogicalState(LogicalStateDescriptions.STATE_STRING_INTERNAL_CHECKING, |
|
47 |
| false, LogicalStateDescriptions.STATE_CODE_INTERNAL_CHECKING); |
|
48 |
| |
|
49 |
| |
|
50 |
| public static final LogicalState STATE_INTERNAL_CHECK_FAILED |
|
51 |
| = new LogicalState(LogicalStateDescriptions.STATE_STRING_INTERNAL_CHECK_FAILED, |
|
52 |
| true, LogicalStateDescriptions.STATE_CODE_INTERNAL_CHECK_FAILED); |
|
53 |
| |
|
54 |
| |
|
55 |
| |
|
56 |
| public static final LogicalState STATE_CHECKED |
|
57 |
| = new LogicalState(LogicalStateDescriptions.STATE_STRING_COMPLETELY_CHECKED, |
|
58 |
| false, LogicalStateDescriptions.STATE_CODE_COMPLETELY_CHECKED); |
|
59 |
| |
|
60 |
| |
|
61 |
| |
|
62 |
| private final String text; |
|
63 |
| |
|
64 |
| |
|
65 |
| private final boolean failure; |
|
66 |
| |
|
67 |
| |
|
68 |
| private final int code; |
|
69 |
| |
|
70 |
| |
|
71 |
| |
|
72 |
| |
|
73 |
| |
|
74 |
| |
|
75 |
| |
|
76 |
| |
|
77 |
| |
|
78 |
12
| private LogicalState(final String text, final boolean failure, final int code) {
|
|
79 |
12
| this.text = text;
|
|
80 |
12
| if (this.text == null) {
|
|
81 |
0
| throw new IllegalArgumentException("text==null");
|
|
82 |
| } |
|
83 |
12
| this.failure = failure;
|
|
84 |
12
| this.code = code;
|
|
85 |
| } |
|
86 |
| |
|
87 |
| |
|
88 |
| |
|
89 |
| |
|
90 |
| |
|
91 |
| |
|
92 |
72
| public final String getText() {
|
|
93 |
72
| return this.text;
|
|
94 |
| } |
|
95 |
| |
|
96 |
| |
|
97 |
| |
|
98 |
| |
|
99 |
| |
|
100 |
| |
|
101 |
142
| public final boolean isFailure() {
|
|
102 |
142
| return this.failure;
|
|
103 |
| } |
|
104 |
| |
|
105 |
| |
|
106 |
| |
|
107 |
| |
|
108 |
| |
|
109 |
| |
|
110 |
0
| public final int getCode() {
|
|
111 |
0
| return this.code;
|
|
112 |
| } |
|
113 |
| |
|
114 |
| |
|
115 |
| |
|
116 |
| |
|
117 |
0
| public final String toString() {
|
|
118 |
0
| return this.text;
|
|
119 |
| } |
|
120 |
| |
|
121 |
| |
|
122 |
| |
|
123 |
| |
|
124 |
0
| public final int hashCode() {
|
|
125 |
0
| return this.text.hashCode();
|
|
126 |
| } |
|
127 |
| |
|
128 |
| |
|
129 |
| |
|
130 |
| |
|
131 |
0
| public final boolean equals(final Object obj) {
|
|
132 |
0
| if (obj == null || !(obj instanceof LogicalState)) {
|
|
133 |
0
| return false;
|
|
134 |
| } |
|
135 |
0
| return text.equals(((LogicalState) obj).text);
|
|
136 |
| } |
|
137 |
| |
|
138 |
| } |