Record Class MembershipProtocol.MembershipView
java.lang.Object
java.lang.Record
com.loomcache.server.cluster.MembershipProtocol.MembershipView
- Enclosing class:
MembershipProtocol
public static record MembershipProtocol.MembershipView(long version, Map<String, MembershipProtocol.MembershipView.MemberInfo> members, @Nullable String leader)
extends Record
Current snapshot of cluster membership.
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordInformation about a cluster member.static enumState of a cluster member. -
Constructor Summary
ConstructorsConstructorDescriptionMembershipView(long version, Map<String, MembershipProtocol.MembershipView.MemberInfo> members, @Nullable String leader) Creates an instance of aMembershipViewrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable Stringleader()Returns the value of theleaderrecord component.members()Returns the value of themembersrecord component.final StringtoString()Returns a string representation of this record class.longversion()Returns the value of theversionrecord component.
-
Constructor Details
-
MembershipView
public MembershipView(long version, Map<String, MembershipProtocol.MembershipView.MemberInfo> members, @Nullable String leader) Creates an instance of aMembershipViewrecord class.- Parameters:
version- the value for theversionrecord componentmembers- the value for themembersrecord componentleader- the value for theleaderrecord component
-
-
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. -
version
public long version()Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
members
Returns the value of themembersrecord component.- Returns:
- the value of the
membersrecord component
-
leader
Returns the value of theleaderrecord component.- Returns:
- the value of the
leaderrecord component
-