Record Class DiagnosticResult
java.lang.Object
java.lang.Record
dev.ua.theroer.magicutils.diagnostics.DiagnosticResult
- Record Components:
checkId- check identifiersuite- suite identifierstatus- result statusseverity- failure importancemessage- human-readable messageduration- measured durationdetails- structured detailserror- captured error, when present
-
Constructor Summary
ConstructorsConstructorDescriptionDiagnosticResult(String checkId, String suite, DiagnosticStatus status, DiagnosticSeverity severity, String message, Duration duration, Map<String, Object> details, @Nullable Throwable error) Creates a normalized result record. -
Method Summary
Modifier and TypeMethodDescriptioncheckId()Returns the value of thecheckIdrecord component.details()Returns the value of thedetailsrecord component.duration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable Throwableerror()Returns the value of theerrorrecord component.static DiagnosticResultfail(String checkId, String suite, DiagnosticSeverity severity, String message, Map<String, Object> details, @Nullable Throwable error) Creates a FAIL result.final inthashCode()Returns a hash code value for this object.message()Returns the value of themessagerecord component.static DiagnosticResultok(String checkId, String suite, DiagnosticSeverity severity, String message, Map<String, Object> details) Creates an OK result.severity()Returns the value of theseverityrecord component.static DiagnosticResultskipped(String checkId, String suite, DiagnosticSeverity severity, String message, Map<String, Object> details) Creates a SKIPPED result.status()Returns the value of thestatusrecord component.suite()Returns the value of thesuiterecord component.final StringtoString()Returns a string representation of this record class.static DiagnosticResultwarn(String checkId, String suite, DiagnosticSeverity severity, String message, Map<String, Object> details) Creates a WARN result.withDuration(Duration duration) Returns a copy with the measured duration attached.
-
Constructor Details
-
DiagnosticResult
public DiagnosticResult(String checkId, String suite, DiagnosticStatus status, DiagnosticSeverity severity, String message, Duration duration, Map<String, Object> details, @Nullable @Nullable Throwable error) Creates a normalized result record.- Parameters:
checkId- check identifiersuite- suite identifierstatus- result statusseverity- failure importancemessage- human-readable messageduration- measured durationdetails- structured detailserror- captured error, when present
-
-
Method Details
-
ok
public static DiagnosticResult ok(String checkId, String suite, DiagnosticSeverity severity, String message, Map<String, Object> details) Creates an OK result.- Parameters:
checkId- check identifiersuite- suite identifierseverity- failure importancemessage- result messagedetails- structured details- Returns:
- OK result
-
warn
public static DiagnosticResult warn(String checkId, String suite, DiagnosticSeverity severity, String message, Map<String, Object> details) Creates a WARN result.- Parameters:
checkId- check identifiersuite- suite identifierseverity- failure importancemessage- result messagedetails- structured details- Returns:
- WARN result
-
fail
public static DiagnosticResult fail(String checkId, String suite, DiagnosticSeverity severity, String message, Map<String, Object> details, @Nullable @Nullable Throwable error) Creates a FAIL result.- Parameters:
checkId- check identifiersuite- suite identifierseverity- failure importancemessage- result messagedetails- structured detailserror- captured error- Returns:
- FAIL result
-
skipped
public static DiagnosticResult skipped(String checkId, String suite, DiagnosticSeverity severity, String message, Map<String, Object> details) Creates a SKIPPED result.- Parameters:
checkId- check identifiersuite- suite identifierseverity- failure importancemessage- result messagedetails- structured details- Returns:
- SKIPPED result
-
withDuration
Returns a copy with the measured duration attached.- Parameters:
duration- measured duration- Returns:
- updated result
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
checkId
-
suite
-
status
-
severity
-
message
-
duration
-
details
-
error
-