17
17
package org .springframework .batch .core ;
18
18
19
19
/**
20
- * Enumeration representing the status of an Execution .
21
- *
20
+ * Enumeration representing the status of an execution .
21
+ *
22
22
* @author Lucas Ward
23
23
* @author Dave Syer
24
24
* @author Michael Minella
@@ -28,14 +28,14 @@ public enum BatchStatus {
28
28
29
29
/**
30
30
* The order of the status values is significant because it can be used to
31
- * aggregate a set of status values - the result should be the maximum
32
- * value. Since COMPLETED is first in the order, only if all elements of an
33
- * execution are COMPLETED will the aggregate status be COMPLETED. A running
34
- * execution is expected to move from STARTING to STARTED to COMPLETED
31
+ * aggregate a set of status values. The result should be the maximum
32
+ * value. Since {@code COMPLETED} is first in the order, only if all elements of an
33
+ * execution are {@code COMPLETED} can the aggregate status be COMPLETED. A running
34
+ * execution is expected to move from {@code STARTING} to {@code STARTED} to {@code COMPLETED}
35
35
* (through the order defined by {@link #upgradeTo(BatchStatus)}). Higher
36
- * values than STARTED signify more serious failure. ABANDONED is used for
37
- * steps that have finished processing, but were not successful, and where
38
- * they should be skipped on a restart (so FAILED is the wrong status).
36
+ * values than {@code STARTED} signify more serious failures. {@code ABANDONED} is used for
37
+ * steps that have finished processing but were not successful and where
38
+ * they should be skipped on a restart (so {@code FAILED} is the wrong status).
39
39
*/
40
40
41
41
/**
@@ -72,7 +72,7 @@ public enum BatchStatus {
72
72
UNKNOWN ;
73
73
74
74
/**
75
- * Convenience method to return the higher value status of the statuses pass in to the method.
75
+ * Convenience method to return the higher value status of the statuses passed to the method.
76
76
*
77
77
* @param status1 The first status to check.
78
78
* @param status2 The second status to check.
@@ -83,8 +83,8 @@ public static BatchStatus max(BatchStatus status1, BatchStatus status2) {
83
83
}
84
84
85
85
/**
86
- * Convenience method to decide if a status indicates work is in progress.
87
- *
86
+ * Convenience method to decide if a status indicates that work is in progress.
87
+ *
88
88
* @return true if the status is STARTING, STARTED
89
89
*/
90
90
public boolean isRunning () {
@@ -94,8 +94,8 @@ public boolean isRunning() {
94
94
/**
95
95
* Convenience method to decide if a status indicates execution was
96
96
* unsuccessful.
97
- *
98
- * @return true if the status is FAILED or greater
97
+ *
98
+ * @return {@code true} if the status is {@code FAILED} or greater.
99
99
*/
100
100
public boolean isUnsuccessful () {
101
101
return this == FAILED || this .isGreaterThan (FAILED );
@@ -104,13 +104,13 @@ public boolean isUnsuccessful() {
104
104
/**
105
105
* Method used to move status values through their logical progression, and
106
106
* override less severe failures with more severe ones. This value is
107
- * compared with the parameter and the one that has higher priority is
108
- * returned. If both are STARTED or less than the value returned is the
109
- * largest in the sequence STARTING, STARTED, COMPLETED. Otherwise the value
107
+ * compared with the parameter, and the one that has higher priority is
108
+ * returned. If both are {@code STARTED} or less than the value returned is the
109
+ * largest in the sequence {@code STARTING}, {@code STARTED}, {@code COMPLETED} . Otherwise, the value
110
110
* returned is the maximum of the two.
111
- *
112
- * @param other another status to compare to
113
- * @return either this or the other status depending on their priority
111
+ *
112
+ * @param other Another status to which to compare.
113
+ * @return either this or the other status, depending on their priority.
114
114
*/
115
115
public BatchStatus upgradeTo (BatchStatus other ) {
116
116
if (isGreaterThan (STARTED ) || other .isGreaterThan (STARTED )) {
@@ -124,36 +124,36 @@ public BatchStatus upgradeTo(BatchStatus other) {
124
124
}
125
125
126
126
/**
127
- * @param other a status value to compare
128
- * @return true if this is greater than other
127
+ * @param other A status value to which to compare.
128
+ * @return {@code true} if this is greater than {@code other}.
129
129
*/
130
130
public boolean isGreaterThan (BatchStatus other ) {
131
131
return this .compareTo (other ) > 0 ;
132
132
}
133
133
134
134
/**
135
- * @param other a status value to compare
136
- * @return true if this is less than other
135
+ * @param other A status value to which to compare.
136
+ * @return {@code true} if this is less than {@code other}.
137
137
*/
138
138
public boolean isLessThan (BatchStatus other ) {
139
139
return this .compareTo (other ) < 0 ;
140
140
}
141
141
142
142
/**
143
- * @param other a status value to compare
144
- * @return true if this is less than other
143
+ * @param other A status value to which to compare.
144
+ * @return {@code true} if this is less than {@code other}.
145
145
*/
146
146
public boolean isLessThanOrEqualTo (BatchStatus other ) {
147
147
return this .compareTo (other ) <= 0 ;
148
148
}
149
149
150
150
/**
151
- * Find a BatchStatus that matches the beginning of the given value. If no
152
- * match is found, return COMPLETED as the default because has is low
151
+ * Find a {@code BatchStatus} that matches the beginning of the given value. If no
152
+ * match is found, return {@code COMPLETED} as the default because it has low
153
153
* precedence.
154
- *
155
- * @param value a string representing a status
156
- * @return a BatchStatus
154
+ *
155
+ * @param value A string representing a status.
156
+ * @return a { BatchStatus} object.
157
157
*/
158
158
public static BatchStatus match (String value ) {
159
159
for (BatchStatus status : values ()) {
0 commit comments