Record Class RemoteError

java.lang.Object
java.lang.Record
org.j7m.middleware.api.RemoteError
Record Components:
code - stable middleware error code
message - safe diagnostic message
details - public diagnostic details
invocationId - invocation or correlation identifier when available
remoteRuntimeId - remote runtime identifier when known
retryable - whether retrying the operation may succeed
dirtyTarget - whether the current target should be considered suspect
All Implemented Interfaces:
Serializable

public record RemoteError(MiddlewareErrorCode code, String message, Map<String,String> details, String invocationId, String remoteRuntimeId, boolean retryable, boolean dirtyTarget) extends Record implements Serializable
Public, redacted description of a local or remote middleware failure.

The record is immutable and thread-safe. Detail values are intended for logs and diagnostics and must not contain secrets. The constructor preserves the iteration order of the supplied detail map in an immutable defensive copy so callers that publish canonical public details can produce deterministic JSON and evidence output.

See Also:
  • Constructor Details

  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • code

      public MiddlewareErrorCode code()
      Returns the value of the code record component.
      Returns:
      the value of the code record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component
    • details

      public Map<String,String> details()
      Returns the value of the details record component.
      Returns:
      the value of the details record component
    • invocationId

      public String invocationId()
      Returns the value of the invocationId record component.
      Returns:
      the value of the invocationId record component
    • remoteRuntimeId

      public String remoteRuntimeId()
      Returns the value of the remoteRuntimeId record component.
      Returns:
      the value of the remoteRuntimeId record component
    • retryable

      public boolean retryable()
      Returns the value of the retryable record component.
      Returns:
      the value of the retryable record component
    • dirtyTarget

      public boolean dirtyTarget()
      Returns the value of the dirtyTarget record component.
      Returns:
      the value of the dirtyTarget record component