Package com.tnsai.agents.groups
Record Class MembershipManager.MembershipStats
java.lang.Object
java.lang.Record
com.tnsai.agents.groups.MembershipManager.MembershipStats
- Enclosing interface:
MembershipManager
public static record MembershipManager.MembershipStats(int currentCount, int totalJoined, int totalLeft, int healthyCount, int unhealthyCount, Duration averageMembershipDuration, Instant oldestMemberJoinedAt)
extends Record
Membership statistics.
-
Constructor Summary
ConstructorsConstructorDescriptionMembershipStats(int currentCount, int totalJoined, int totalLeft, int healthyCount, int unhealthyCount, Duration averageMembershipDuration, Instant oldestMemberJoinedAt) Creates an instance of aMembershipStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaverageMembershipDurationrecord component.intReturns the value of thecurrentCountrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thehealthyCountrecord component.Returns the value of theoldestMemberJoinedAtrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalJoinedrecord component.intReturns the value of thetotalLeftrecord component.intReturns the value of theunhealthyCountrecord component.
-
Constructor Details
-
MembershipStats
public MembershipStats(int currentCount, int totalJoined, int totalLeft, int healthyCount, int unhealthyCount, Duration averageMembershipDuration, Instant oldestMemberJoinedAt) Creates an instance of aMembershipStatsrecord class.- Parameters:
currentCount- the value for thecurrentCountrecord componenttotalJoined- the value for thetotalJoinedrecord componenttotalLeft- the value for thetotalLeftrecord componenthealthyCount- the value for thehealthyCountrecord componentunhealthyCount- the value for theunhealthyCountrecord componentaverageMembershipDuration- the value for theaverageMembershipDurationrecord componentoldestMemberJoinedAt- the value for theoldestMemberJoinedAtrecord 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 '=='. -
currentCount
public int currentCount()Returns the value of thecurrentCountrecord component.- Returns:
- the value of the
currentCountrecord component
-
totalJoined
public int totalJoined()Returns the value of thetotalJoinedrecord component.- Returns:
- the value of the
totalJoinedrecord component
-
totalLeft
public int totalLeft()Returns the value of thetotalLeftrecord component.- Returns:
- the value of the
totalLeftrecord component
-
healthyCount
public int healthyCount()Returns the value of thehealthyCountrecord component.- Returns:
- the value of the
healthyCountrecord component
-
unhealthyCount
public int unhealthyCount()Returns the value of theunhealthyCountrecord component.- Returns:
- the value of the
unhealthyCountrecord component
-
averageMembershipDuration
Returns the value of theaverageMembershipDurationrecord component.- Returns:
- the value of the
averageMembershipDurationrecord component
-
oldestMemberJoinedAt
Returns the value of theoldestMemberJoinedAtrecord component.- Returns:
- the value of the
oldestMemberJoinedAtrecord component
-