Record Class ConsensusCommandResult
java.lang.Object
java.lang.Record
org.j7m.middleware.api.consensus.ConsensusCommandResult
- Record Components:
commandId- command idaccepted- whether the command was accepted by the current leadercommitted- whether the command reached majority commitindex- assigned index or zeroleaderId- observed leader idreason- safe reason code
- All Implemented Interfaces:
Serializable
public record ConsensusCommandResult(String commandId, boolean accepted, boolean committed, LogIndex index, ConsensusNodeId leaderId, String reason)
extends Record
implements Serializable
Result of submitting a command to the replicated log.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConsensusCommandResult(String commandId, boolean accepted, boolean committed, LogIndex index, ConsensusNodeId leaderId, String reason) Creates a command result. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepted()Returns the value of theacceptedrecord component.Returns the value of thecommandIdrecord component.booleanReturns the value of thecommittedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.index()Returns the value of theindexrecord component.leaderId()Returns the value of theleaderIdrecord component.reason()Returns the value of thereasonrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConsensusCommandResult
public ConsensusCommandResult(String commandId, boolean accepted, boolean committed, LogIndex index, ConsensusNodeId leaderId, String reason) Creates a command result.
-
-
Method Details
-
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. -
commandId
-
accepted
-
committed
-
index
-
leaderId
-
reason
-