All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.noenv.wiremongo.command.bulkwrite.BulkWriteBaseCommand Maven / Gradle / Ivy

There is a newer version: 4.5.10
Show newest version
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(",")));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy