com.azure.cosmos.implementation.batch.ServerOperationBatchRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-cosmos Show documentation
Show all versions of azure-cosmos Show documentation
This Package contains Microsoft Azure Cosmos SDK (with Reactive Extension Reactor support) for Azure Cosmos DB SQL API
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.cosmos.implementation.batch;
import com.azure.cosmos.models.CosmosItemOperation;
import java.util.List;
import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull;
final class ServerOperationBatchRequest {
private final PartitionKeyRangeServerBatchRequest batchRequest;
private final List pendingOperations;
/**
* Creates a new pair of batch request and pending operations.
*
* @param batchRequest the {@link ServerBatchRequest batch request}
* @param operations the list of {@link CosmosItemOperation pendingOperations} for the batch request.
*/
ServerOperationBatchRequest(
final PartitionKeyRangeServerBatchRequest batchRequest,
final List operations) {
checkNotNull(batchRequest, "expected non-null batchRequest");
checkNotNull(operations, "expected non-null pendingOperations");
this.batchRequest = batchRequest;
this.pendingOperations = operations;
}
/**
* Gets the PartitionKeyRangeServerBatchRequest.
*
* @return PartitionKeyRangeServerBatchRequest
*/
PartitionKeyRangeServerBatchRequest getBatchRequest() {
return this.batchRequest;
}
/**
* Gets list of CosmosItemOperation.
*
* @return list of CosmosItemOperation.
*/
List getBatchPendingOperations() {
return this.pendingOperations;
}
}