@Immutable public final class ConnectionId extends java.lang.Object
Contains a locally created id and if available the MongoDB server created connection id
| Constructor and Description |
|---|
ConnectionId(ServerId serverId)
Construct an instance with the given server id.
|
ConnectionId(ServerId serverId,
int localValue,
java.lang.Integer serverValue)
Construct an instance with the given serverId, localValue, and serverValue.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
int |
getLocalValue()
Gets the locally created id value for the connection
|
ServerId |
getServerId()
Gets the server id.
|
java.lang.Integer |
getServerValue()
Gets the server generated id value for the connection or null if not set.
|
int |
hashCode() |
java.lang.String |
toString() |
ConnectionId |
withServerValue(int serverValue)
Creates a new connectionId with the set server value
|
public ConnectionId(ServerId serverId)
serverId - the server idpublic ConnectionId(ServerId serverId, int localValue, java.lang.Integer serverValue)
Useful for testing, but generally prefer withServerValue(int)
serverId - the server idlocalValue - the local valueserverValue - the server value, which may be nullwithServerValue(int)public ConnectionId withServerValue(int serverValue)
serverValue - the server valuepublic ServerId getServerId()
public int getLocalValue()
public java.lang.Integer getServerValue()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2010 - 2023 Adobe. All Rights Reserved