public final class SplittablePayload extends Object
The command will consume as much of the payload as possible. The hasAnotherSplit()
method will return true if there is
another split to consume, getNextSplit()
method will return the next SplittablePayload.
Connection.command(String, org.bson.BsonDocument, org.bson.FieldNameValidator, com.mongodb.ReadPreference,
org.bson.codecs.Decoder, com.mongodb.session.SessionContext, boolean, com.mongodb.connection.SplittablePayload,
org.bson.FieldNameValidator)
,
AsyncConnection.commandAsync(String, org.bson.BsonDocument, org.bson.FieldNameValidator,
com.mongodb.ReadPreference, org.bson.codecs.Decoder, com.mongodb.session.SessionContext, boolean,
com.mongodb.connection.SplittablePayload, org.bson.FieldNameValidator, com.mongodb.async.SingleResultCallback)
Modifier and Type | Class | Description |
---|---|---|
static class |
SplittablePayload.Type |
The type of the payload.
|
Constructor | Description |
---|---|
SplittablePayload(SplittablePayload.Type payloadType,
List<BsonDocument> payload) |
Create a new instance
|
Modifier and Type | Method | Description |
---|---|---|
SplittablePayload |
getNextSplit() |
|
List<BsonDocument> |
getPayload() |
|
String |
getPayloadName() |
|
SplittablePayload.Type |
getPayloadType() |
|
int |
getPosition() |
|
boolean |
hasAnotherSplit() |
|
boolean |
isEmpty() |
|
void |
setPosition(int position) |
Sets the current position in the payload
|
public SplittablePayload(SplittablePayload.Type payloadType, List<BsonDocument> payload)
payloadType
- the payload typepayload
- the payloadpublic SplittablePayload.Type getPayloadType()
public String getPayloadName()
public List<BsonDocument> getPayload()
public int getPosition()
public void setPosition(int position)
position
- the positionpublic boolean hasAnotherSplit()
public SplittablePayload getNextSplit()
public boolean isEmpty()