Package com.tnsai.observability.errors
Record Class CauseInfo
java.lang.Object
java.lang.Record
com.tnsai.observability.errors.CauseInfo
- Record Components:
errorClass- fully-qualified throwable class namemessage- user-visible message — pass throughRedactorbefore serializationlocation- top stack frame in the form"Class.method(File.java:42)"(may be null if no stack frames)
Compact summary of a single throwable in a flattened cause chain.
Operators see the full chain in one structured view rather than
walking getCause().getCause().getCause(). Each entry carries
just enough to identify the origin: the throwable's fully-qualified
class name, its (redaction-safe) message, and the top stack frame.
- Since:
- 0.5.0 (issue #86)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theerrorClassrecord component.final inthashCode()Returns a hash code value for this object.location()Returns the value of thelocationrecord component.message()Returns the value of themessagerecord component.static CauseInfoBuild aCauseInfofrom a throwable.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CauseInfo
Creates an instance of aCauseInforecord class.- Parameters:
errorClass- the value for theerrorClassrecord componentmessage- the value for themessagerecord componentlocation- the value for thelocationrecord component
-
-
Method Details
-
of
Build aCauseInfofrom a throwable. The top stack frame (if any) is recorded aslocation. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
errorClass
Returns the value of theerrorClassrecord component.- Returns:
- the value of the
errorClassrecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-