Record Class RequestVoteResponse
java.lang.Object
java.lang.Record
org.j7m.middleware.api.consensus.RequestVoteResponse
- Record Components:
groupId- group idterm- responder termnodeId- responder idvoteGranted- whether the vote was grantedreason- safe reason code
- All Implemented Interfaces:
Serializable
public record RequestVoteResponse(ConsensusGroupId groupId, ConsensusTerm term, ConsensusNodeId nodeId, boolean voteGranted, String reason)
extends Record
implements Serializable
Raft-like RequestVote response.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRequestVoteResponse(ConsensusGroupId groupId, ConsensusTerm term, ConsensusNodeId nodeId, boolean voteGranted, String reason) Creates a vote response. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.groupId()Returns the value of thegroupIdrecord component.final inthashCode()Returns a hash code value for this object.nodeId()Returns the value of thenodeIdrecord component.reason()Returns the value of thereasonrecord component.term()Returns the value of thetermrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of thevoteGrantedrecord component.
-
Constructor Details
-
RequestVoteResponse
public RequestVoteResponse(ConsensusGroupId groupId, ConsensusTerm term, ConsensusNodeId nodeId, boolean voteGranted, String reason) Creates a vote response.
-
-
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. -
groupId
-
term
-
nodeId
-
voteGranted
public boolean voteGranted()Returns the value of thevoteGrantedrecord component.- Returns:
- the value of the
voteGrantedrecord component
-
reason
-