Class TrackedError
java.lang.Object
io.github.projectunified.faststats.errortracker.TrackedError
An error report with tracking metadata.
The error is snapshotted when this report is created, so modifications of the
original Throwable afterwards do not change the report or its identity.
Reports are deduplicated by their error snapshot only; the metadata added later
(handled(boolean), attributes(Map)) is not part of the identity.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn immutable snapshot of a throwable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of the additional error attributes.attributes(Consumer<Map<String, Object>> consumer) Modifies the additional error attributes using a consumer.attributes(Supplier<Map<String, Object>> supplier) Sets the additional error attributes using a supplier.attributes(Map<String, Object> attributes) Sets the additional error attributes.booleanerror()Returns the snapshot of the tracked error.booleanhandled()Returns whether the error was handled.handled(boolean handled) Sets whether the error was handled.inthashCode()
-
Constructor Details
-
TrackedError
-
-
Method Details
-
error
Returns the snapshot of the tracked error.- Returns:
- the error snapshot
-
handled
public boolean handled()Returns whether the error was handled.- Returns:
- whether the error was handled
-
handled
Sets whether the error was handled.- Parameters:
handled- whether the error was handled- Returns:
- this tracked error
-
attributes
-
attributes
Sets the additional error attributes.- Parameters:
attributes- the additional error attributes- Returns:
- this tracked error
-
attributes
Modifies the additional error attributes using a consumer.- Parameters:
consumer- the consumer to modify attributes- Returns:
- this tracked error
-
attributes
Sets the additional error attributes using a supplier.- Parameters:
supplier- the supplier of attributes- Returns:
- this tracked error
-
equals
-
hashCode
-