com.noenv.wiremongo.command.bulkwrite.BulkWriteBaseCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vertx-wiremongo Show documentation
Show all versions of vertx-wiremongo Show documentation
Lightweight mongo mocking for Vert.x
package com.noenv.wiremongo.command.bulkwrite;
import com.noenv.wiremongo.command.collection.WithCollectionCommand;
import io.vertx.ext.mongo.BulkOperation;
import java.util.List;
import java.util.stream.Collectors;
public class BulkWriteBaseCommand extends WithCollectionCommand {
private final List operations;
public BulkWriteBaseCommand(String collection, List operations) {
this("bulkWrite", collection, operations);
}
public BulkWriteBaseCommand(String method, String collection, List operations) {
super(method, collection);
this.operations = operations;
}
public List getOperations() {
return operations;
}
@Override
public String toString() {
return super.toString() + ", operations: " + (operations == null ? "null" : operations.stream()
.map(o -> o.toJson().encode()).collect(Collectors.joining(",")));
}
}