public final class SplittablePayload
extends java.lang.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 and Description |
---|---|
static class |
SplittablePayload.Type
The type of the payload.
|
Constructor and Description |
---|
SplittablePayload(SplittablePayload.Type payloadType,
java.util.List<BsonDocument> payload)
Create a new instance
|
Modifier and Type | Method and Description |
---|---|
SplittablePayload |
getNextSplit() |
java.util.List<BsonDocument> |
getPayload() |
java.lang.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, java.util.List<BsonDocument> payload)
payloadType
- the payload typepayload
- the payloadpublic SplittablePayload.Type getPayloadType()
public java.lang.String getPayloadName()
public java.util.List<BsonDocument> getPayload()
public int getPosition()
public void setPosition(int position)
position
- the positionpublic boolean hasAnotherSplit()
public SplittablePayload getNextSplit()
public boolean isEmpty()