Record Class ReliabilityDecision
java.lang.Object
java.lang.Record
org.j7m.middleware.api.reliability.ReliabilityDecision
- Record Components:
status- stable reliability statusaccepted- whether the operation may proceederrorCode- middleware error code when rejectedretrySafe- whether retry is safemessage- stable safe status textmetadata- safe diagnostic metadata
- All Implemented Interfaces:
Serializable
public record ReliabilityDecision(ReliabilityStatus status, boolean accepted, MiddlewareErrorCode errorCode, boolean retrySafe, String message, Map<String,String> metadata)
extends Record
implements Serializable
Result of a reliability policy decision.
The record is immutable, serializable, and thread-safe. Messages are stable status text and must not include raw payloads or sensitive keys.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionReliabilityDecision(ReliabilityStatus status, boolean accepted, MiddlewareErrorCode errorCode, boolean retrySafe, String message, Map<String, String> metadata) Creates a validated reliability decision. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepted()Returns the value of theacceptedrecord component.static ReliabilityDecisionaccepted(ReliabilityStatus status, boolean retrySafe) Creates an accepted decision.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theerrorCoderecord component.final inthashCode()Returns a hash code value for this object.message()Returns the value of themessagerecord component.metadata()Returns the value of themetadatarecord component.static ReliabilityDecisionrejected(ReliabilityStatus status, MiddlewareErrorCode errorCode, String message) Creates a rejected decision.booleanReturns the value of theretrySaferecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ReliabilityDecision
public ReliabilityDecision(ReliabilityStatus status, boolean accepted, MiddlewareErrorCode errorCode, boolean retrySafe, String message, Map<String, String> metadata) Creates a validated reliability decision.
-
-
Method Details
-
accepted
Creates an accepted decision.- Parameters:
status- decision statusretrySafe- retry safety- Returns:
- accepted decision
-
rejected
public static ReliabilityDecision rejected(ReliabilityStatus status, MiddlewareErrorCode errorCode, String message) Creates a rejected decision.- Parameters:
status- decision statuserrorCode- middleware error codemessage- safe status text- Returns:
- rejected decision
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
status
-
accepted
-
errorCode
-
retrySafe
-
message
-
metadata
-