Record Class ConsistencyGroupId
java.lang.Object
java.lang.Record
com.loomcache.server.cp.ConsistencyGroupId
- Record Components:
name- the human-readable name of the group (e.g., "locks", "counters", "latches"), must not be null or emptygroupId- the unique numeric identifier for this group (typically auto-assigned), must be non-negative
- All Implemented Interfaces:
Serializable
Identifies a Consistency group (Consistent/Partition-tolerant group) with a name and unique ID.
Purpose: Consistency groups are logical divisions managed by the Consistency Subsystem for Raft-based strong consistency. This record uniquely identifies each group via the combination of (name + groupId).
Thread Safety: This record is immutable and thread-safe. Multiple threads can safely share instances without synchronization.
Serialization: This record is serializable for distributed storage and network transmission.
- Since:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConsistencyGroupId(String name, long groupId) Compact constructor for ConsistencyGroupId with validation. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longgroupId()Returns the value of thegroupIdrecord component.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
ConsistencyGroupId
Compact constructor for ConsistencyGroupId with validation.Ensures the group name is not null or empty, and the group ID is non-negative.
- Parameters:
name- the group name (must not be null or empty)groupId- the group ID (must be non-negative)- Throws:
NullPointerException- if name is nullIllegalArgumentException- if name is empty or groupId is negative
-
-
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. -
name
-
groupId
-