@Immutable public final class ConnectionId extends java.lang.Object
Contains a locally created id and if available the MongoDB server created connection id
Modifier and Type | Field and Description |
---|---|
private static java.util.concurrent.atomic.AtomicInteger |
INCREMENTING_ID |
private int |
localValue |
private ServerId |
serverId |
private java.lang.Integer |
serverValue |
private java.lang.String |
stringValue |
Modifier | Constructor and Description |
---|---|
(package private) |
ConnectionId(ServerId serverId)
Construct an instance with the given server id.
|
private |
ConnectionId(ServerId serverId,
int localValue,
java.lang.Integer 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() |
(package private) ConnectionId |
withServerValue(int serverValue) |
private static final java.util.concurrent.atomic.AtomicInteger INCREMENTING_ID
private final ServerId serverId
private final int localValue
private final java.lang.Integer serverValue
private final java.lang.String stringValue
ConnectionId(ServerId serverId)
serverId
- the server idprivate ConnectionId(ServerId serverId, int localValue, java.lang.Integer serverValue)
ConnectionId withServerValue(int serverValue)
public ServerId getServerId()
public int getLocalValue()
public java.lang.Integer getServerValue()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object