|
|
|
@ -20,7 +20,6 @@ import java.util.Collections; |
|
|
|
import java.util.LinkedHashMap; |
|
|
|
import java.util.LinkedHashMap; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonInclude; |
|
|
|
import com.fasterxml.jackson.annotation.JsonInclude; |
|
|
|
import com.fasterxml.jackson.annotation.JsonInclude.Include; |
|
|
|
import com.fasterxml.jackson.annotation.JsonInclude.Include; |
|
|
|
|
|
|
|
|
|
|
|
@ -47,7 +46,6 @@ import org.springframework.util.Assert; |
|
|
|
* @author Christian Dupuis |
|
|
|
* @author Christian Dupuis |
|
|
|
* @author Phillip Webb |
|
|
|
* @author Phillip Webb |
|
|
|
* @author Michael Pratt |
|
|
|
* @author Michael Pratt |
|
|
|
* @author Moritz Halbritter |
|
|
|
|
|
|
|
* @since 1.1.0 |
|
|
|
* @since 1.1.0 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@JsonInclude(Include.NON_EMPTY) |
|
|
|
@JsonInclude(Include.NON_EMPTY) |
|
|
|
@ -57,8 +55,6 @@ public final class Health extends HealthComponent { |
|
|
|
|
|
|
|
|
|
|
|
private final Map<String, Object> details; |
|
|
|
private final Map<String, Object> details; |
|
|
|
|
|
|
|
|
|
|
|
private final Throwable exception; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Create a new {@link Health} instance with the specified status and details. |
|
|
|
* Create a new {@link Health} instance with the specified status and details. |
|
|
|
* @param builder the Builder to use |
|
|
|
* @param builder the Builder to use |
|
|
|
@ -67,13 +63,11 @@ public final class Health extends HealthComponent { |
|
|
|
Assert.notNull(builder, "Builder must not be null"); |
|
|
|
Assert.notNull(builder, "Builder must not be null"); |
|
|
|
this.status = builder.status; |
|
|
|
this.status = builder.status; |
|
|
|
this.details = Collections.unmodifiableMap(builder.details); |
|
|
|
this.details = Collections.unmodifiableMap(builder.details); |
|
|
|
this.exception = builder.exception; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Health(Status status, Map<String, Object> details) { |
|
|
|
Health(Status status, Map<String, Object> details) { |
|
|
|
this.status = status; |
|
|
|
this.status = status; |
|
|
|
this.details = details; |
|
|
|
this.details = details; |
|
|
|
this.exception = null; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
@ -107,11 +101,6 @@ public final class Health extends HealthComponent { |
|
|
|
return status(getStatus()).build(); |
|
|
|
return status(getStatus()).build(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@JsonIgnore |
|
|
|
|
|
|
|
Throwable getException() { |
|
|
|
|
|
|
|
return this.exception; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean equals(Object obj) { |
|
|
|
public boolean equals(Object obj) { |
|
|
|
if (obj == this) { |
|
|
|
if (obj == this) { |
|
|
|
|