Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
4bc6a0f4
Commit
4bc6a0f4
authored
May 21, 2014
by
Christian Dupuis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Status.status to Status.code
parent
46481887
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
OrderedHealthAggregator.java
...ramework/boot/actuate/health/OrderedHealthAggregator.java
+2
-2
Status.java
.../java/org/springframework/boot/actuate/health/Status.java
+9
-7
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/OrderedHealthAggregator.java
View file @
4bc6a0f4
...
...
@@ -66,8 +66,8 @@ public class OrderedHealthAggregator implements HealthAggregator {
@Override
public
int
compare
(
Status
s1
,
Status
s2
)
{
return
Integer
.
valueOf
(
OrderedHealthAggregator
.
this
.
statusOrder
.
indexOf
(
s1
.
get
Status
())).
compareTo
(
Integer
.
valueOf
(
OrderedHealthAggregator
.
this
.
statusOrder
.
indexOf
(
s2
.
get
Status
())));
OrderedHealthAggregator
.
this
.
statusOrder
.
indexOf
(
s1
.
get
Code
())).
compareTo
(
Integer
.
valueOf
(
OrderedHealthAggregator
.
this
.
statusOrder
.
indexOf
(
s2
.
get
Code
())));
}
});
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Status.java
View file @
4bc6a0f4
...
...
@@ -21,6 +21,7 @@ import org.springframework.util.ObjectUtils;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude.Include
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
/**
* Value object to express state of a component or subsystem.
...
...
@@ -58,7 +59,7 @@ public class Status {
*/
public
static
final
Status
OUT_OF_SERVICE
=
new
Status
(
"OUT_OF_SERVICE"
);
private
final
String
status
;
private
final
String
code
;
private
final
String
description
;
...
...
@@ -67,14 +68,15 @@ public class Status {
}
public
Status
(
String
code
,
String
description
)
{
Assert
.
notNull
(
code
,
"
Status
must not be null"
);
Assert
.
notNull
(
code
,
"
Code
must not be null"
);
Assert
.
notNull
(
description
,
"Description must not be null"
);
this
.
status
=
code
;
this
.
code
=
code
;
this
.
description
=
description
;
}
public
String
getStatus
()
{
return
this
.
status
;
@JsonProperty
(
"status"
)
public
String
getCode
()
{
return
this
.
code
;
}
@JsonInclude
(
Include
.
NON_EMPTY
)
...
...
@@ -88,13 +90,13 @@ public class Status {
return
true
;
}
if
(
obj
!=
null
&&
obj
instanceof
Status
)
{
return
ObjectUtils
.
nullSafeEquals
(
this
.
status
,
((
Status
)
obj
).
status
);
return
ObjectUtils
.
nullSafeEquals
(
this
.
code
,
((
Status
)
obj
).
code
);
}
return
false
;
}
@Override
public
int
hashCode
()
{
return
this
.
status
.
hashCode
();
return
this
.
code
.
hashCode
();
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment