Record Class ConsensusMemberSet
java.lang.Object
java.lang.Record
org.j7m.middleware.api.consensus.ConsensusMemberSet
- Record Components:
members- sorted members
- All Implemented Interfaces:
Serializable
public record ConsensusMemberSet(List<ConsensusMember> members)
extends Record
implements Serializable
Immutable fixed membership set.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(ConsensusNodeId nodeId) Returns whether the node is a configured member.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmajority()Returns the majority size.members()Returns the value of themembersrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConsensusMemberSet
Creates a member set.
-
-
Method Details
-
majority
public int majority()Returns the majority size.- Returns:
- majority count
-
contains
Returns whether the node is a configured member.- Parameters:
nodeId- node id- Returns:
- true when the node is a member
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
members
-