Record Class SagaCommandResult
java.lang.Object
java.lang.Record
org.j7m.middleware.api.saga.SagaCommandResult
- Record Components:
success- whether the step action succeededretryable- whether a failed result may be retriedreasonCode- stable machine-readable result codemetadata- redacted result metadata
- All Implemented Interfaces:
Serializable
public record SagaCommandResult(boolean success, boolean retryable, String reasonCode, Map<String,String> metadata)
extends Record
implements Serializable
Safe step command result.
The result records whether the action succeeded, whether failure is retryable, and a stable reason code for audit consumers. Metadata is redacted and must not contain command payload material.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSagaCommandResult(boolean success, boolean retryable, String reasonCode, Map<String, String> metadata) Creates a validated result. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static SagaCommandResultReturns a failed command result.final inthashCode()Returns a hash code value for this object.metadata()Returns the value of themetadatarecord component.Returns the value of thereasonCoderecord component.booleanReturns the value of theretryablerecord component.static SagaCommandResultReturns a successful command result.booleansuccess()Returns the value of thesuccessrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SagaCommandResult
-
-
Method Details
-
succeeded
Returns a successful command result.- Returns:
- immutable success result
-
failed
Returns a failed command result.- Parameters:
reasonCode- stable failure reason coderetryable- whether retry policy may retry the failure- Returns:
- immutable failure result
-
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. -
success
-
retryable
-
reasonCode
Returns the value of thereasonCoderecord component.- Returns:
- the value of the
reasonCoderecord component
-
metadata
-