public final class ReadConcern extends Object
Modifier and Type | Field | Description |
---|---|---|
static ReadConcern |
DEFAULT |
Use the servers default read concern.
|
static ReadConcern |
LINEARIZABLE |
The linearizable read concern.
|
static ReadConcern |
LOCAL |
The local read concern.
|
static ReadConcern |
MAJORITY |
The majority read concern.
|
Constructor | Description |
---|---|
ReadConcern(ReadConcernLevel level) |
Construct a new read concern
|
Modifier and Type | Method | Description |
---|---|---|
BsonDocument |
asDocument() |
Gets this read concern as a document.
|
boolean |
equals(Object o) |
|
ReadConcernLevel |
getLevel() |
Gets the read concern level.
|
int |
hashCode() |
|
boolean |
isServerDefault() |
public static final ReadConcern DEFAULT
public static final ReadConcern LOCAL
public static final ReadConcern MAJORITY
public static final ReadConcern LINEARIZABLE
This read concern is only compatible with ReadPreference.primary()
.
public ReadConcern(ReadConcernLevel level)
level
- the read concern level@Nullable public ReadConcernLevel getLevel()
public boolean isServerDefault()
public BsonDocument asDocument()