public final class GroupId extends Object
In DJ versions previous to 6.5, group IDs are represented as integers (byte). Since 6.5, group IDs are represented as case insensitive strings. This class helps converting to/from old/new group IDs to deal with legacy protocol versions.
Modifier and Type | Field and Description |
---|---|
static GroupId |
DEFAULT_GROUP_ID
The default group ID to use when no group ID is set by the users.
|
Modifier and Type | Method and Description |
---|---|
String |
asString()
Returns this groupId as a string value.
|
boolean |
equals(Object o) |
static GroupId |
fromLegacyGroupId(byte legacyGroupId)
Returns a
GroupId from a replication message sent by a replica running a legacy version. |
int |
hashCode() |
static GroupId |
newGroupId(String groupId)
Generates a new
GroupId from the provided value. |
byte |
toLegacyGroupId()
Maps a string groupID to a format accepted by legacy versions of the replication, if possible.
|
String |
toString() |
public static final GroupId DEFAULT_GROUP_ID
public String asString()
public byte toLegacyGroupId()
Strings representing a number from 1 to 127 (as supported by legacy versions) will return the integer value. All others will return 1.
byte
representation of this groupIdpublic static GroupId fromLegacyGroupId(byte legacyGroupId)
GroupId
from a replication message sent by a replica running a legacy version.legacyGroupId
- the groupID from a replication messageGroupId
public static GroupId newGroupId(String groupId)
GroupId
from the provided value.groupId
- the new groupIDGroupId
Copyright 2010-2022 ForgeRock AS.