Record Class Diagnostic
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.diagnostic.Diagnostic
- Record Components:
severity- how serious it iscode- stable machine-readable code, e.g.machineengine:duplicate_keymessage- human-readable explanationsource- the addon responsible, if known. Errors disable that addon's content.subject- the entry concerned, if anylocation- where it was defined (file, path), if knowncontext- extra key/value details for debugging
public record Diagnostic(@NotNull Severity severity, @NotNull net.kyori.adventure.key.Key code, @NotNull String message, @Nullable AddonId source, @Nullable net.kyori.adventure.key.Key subject, @Nullable String location, @NotNull Map<String,Object> context)
extends Record
One validation finding (ARCHITECTURE.md ยง24).
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDiagnostic(@NotNull Severity severity, @NotNull net.kyori.adventure.key.Key code, @NotNull String message, @Nullable AddonId source, @Nullable net.kyori.adventure.key.Key subject, @Nullable String location, @NotNull Map<String, Object> context) Creates an instance of aDiagnosticrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull net.kyori.adventure.key.Keycode()Returns the value of thecoderecord component.context()Returns the value of thecontextrecord component.final booleanIndicates whether some other object is "equal to" this one.static @NotNull Diagnostic.Builder@NotNull Stringformat()One-line, log-friendly rendering.final inthashCode()Returns a hash code value for this object.static @NotNull Diagnostic.BuilderbooleanisError()@Nullable Stringlocation()Returns the value of thelocationrecord component.@NotNull Stringmessage()Returns the value of themessagerecord component.@NotNull Severityseverity()Returns the value of theseverityrecord component.@Nullable AddonIdsource()Returns the value of thesourcerecord component.@Nullable net.kyori.adventure.key.Keysubject()Returns the value of thesubjectrecord component.final StringtoString()Returns a string representation of this record class.static @NotNull Diagnostic.Builder@NotNull DiagnosticwithSource(@Nullable AddonId addon)
-
Constructor Details
-
Diagnostic
public Diagnostic(@NotNull @NotNull Severity severity, @NotNull @NotNull net.kyori.adventure.key.Key code, @NotNull @NotNull String message, @Nullable @Nullable AddonId source, @Nullable @Nullable net.kyori.adventure.key.Key subject, @Nullable @Nullable String location, @NotNull @NotNull Map<String, Object> context) Creates an instance of aDiagnosticrecord class.- Parameters:
severity- the value for theseverityrecord componentcode- the value for thecoderecord componentmessage- the value for themessagerecord componentsource- the value for thesourcerecord componentsubject- the value for thesubjectrecord componentlocation- the value for thelocationrecord componentcontext- the value for thecontextrecord component
-
-
Method Details
-
error
@NotNull public static @NotNull Diagnostic.Builder error(@NotNull @NotNull net.kyori.adventure.key.Key code, @NotNull @NotNull String message) -
warning
@NotNull public static @NotNull Diagnostic.Builder warning(@NotNull @NotNull net.kyori.adventure.key.Key code, @NotNull @NotNull String message) -
info
@NotNull public static @NotNull Diagnostic.Builder info(@NotNull @NotNull net.kyori.adventure.key.Key code, @NotNull @NotNull String message) -
isError
public boolean isError() -
withSource
- Returns:
- a copy attributed to
addon
-
format
One-line, log-friendly rendering. -
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). -
severity
-
code
-
message
-
source
-
subject
-
location
-
context
-