Record Class MembershipProtocol.MembershipEvent.LeaderChanged
java.lang.Object
java.lang.Record
com.loomcache.server.cluster.MembershipProtocol.MembershipEvent.LeaderChanged
- All Implemented Interfaces:
MembershipProtocol.MembershipEvent
- Enclosing interface:
MembershipProtocol.MembershipEvent
public static record MembershipProtocol.MembershipEvent.LeaderChanged(String oldLeader, String newLeader, long term)
extends Record
implements MembershipProtocol.MembershipEvent
The cluster leader has changed.
- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface MembershipProtocol.MembershipEvent
MembershipProtocol.MembershipEvent.LeaderChanged, MembershipProtocol.MembershipEvent.MemberJoined, MembershipProtocol.MembershipEvent.MemberLeft, MembershipProtocol.MembershipEvent.MemberRecovered, MembershipProtocol.MembershipEvent.MemberSuspected -
Constructor Summary
ConstructorsConstructorDescriptionLeaderChanged(String oldLeader, String newLeader, long term) Creates an instance of aLeaderChangedrecord 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.Returns the value of thenewLeaderrecord component.Returns the value of theoldLeaderrecord component.longterm()Returns the value of thetermrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LeaderChanged
-
-
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. -
oldLeader
Returns the value of theoldLeaderrecord component.- Returns:
- the value of the
oldLeaderrecord component
-
newLeader
Returns the value of thenewLeaderrecord component.- Returns:
- the value of the
newLeaderrecord component
-
term
public long term()Returns the value of thetermrecord component.- Returns:
- the value of the
termrecord component
-