Record Class DefaultLeaderStateChanged
java.lang.Object
java.lang.Record
org.opendaylight.controller.cluster.notifications.DefaultLeaderStateChanged
- All Implemented Interfaces:
LeaderStateChanged,MemberNotication
@NonNullByDefault
public record DefaultLeaderStateChanged(String memberId, @Nullable String leaderId, short leaderPayloadVersion)
extends Record
implements LeaderStateChanged
Default implementation of
LeaderStateChanged.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultLeaderStateChanged(String memberId, @Nullable String leaderId, short leaderPayloadVersion) Creates an instance of aDefaultLeaderStateChangedrecord 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 StringleaderId()Returns the value of theleaderIdrecord component.shortReturns the value of theleaderPayloadVersionrecord component.memberId()Returns the value of thememberIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DefaultLeaderStateChanged
public DefaultLeaderStateChanged(String memberId, @Nullable String leaderId, short leaderPayloadVersion) Creates an instance of aDefaultLeaderStateChangedrecord class.- Parameters:
memberId- the value for thememberIdrecord componentleaderId- the value for theleaderIdrecord componentleaderPayloadVersion- the value for theleaderPayloadVersionrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
memberId
Returns the value of thememberIdrecord component.- Specified by:
memberIdin interfaceMemberNotication- Returns:
- the value of the
memberIdrecord component
-
leaderId
Returns the value of theleaderIdrecord component.- Specified by:
leaderIdin interfaceLeaderStateChanged- Returns:
- the value of the
leaderIdrecord component
-
leaderPayloadVersion
public short leaderPayloadVersion()Returns the value of theleaderPayloadVersionrecord component.- Specified by:
leaderPayloadVersionin interfaceLeaderStateChanged- Returns:
- the value of the
leaderPayloadVersionrecord component
-