Package com.mongodb

Class MongoBulkWriteException

  • All Implemented Interfaces:
    java.io.Serializable

    public class MongoBulkWriteException
    extends MongoServerException
    An exception that represents all errors associated with a bulk write operation.
    Since:
    3.0
    See Also:
    Serialized Form
    • Constructor Detail

      • MongoBulkWriteException

        public MongoBulkWriteException​(BulkWriteResult writeResult,
                                       java.util.List<BulkWriteError> writeErrors,
                                       @Nullable
                                       WriteConcernError writeConcernError,
                                       ServerAddress serverAddress)
        Constructs a new instance.
        Parameters:
        writeResult - the write result
        writeErrors - the list of errors
        writeConcernError - the write concern error
        serverAddress - the server address.
    • Method Detail

      • getWriteResult

        public BulkWriteResult getWriteResult()
        The result of all successfully processed write operations. This will never be null.
        Returns:
        the bulk write result
      • getWriteErrors

        public java.util.List<BulkWriteError> getWriteErrors()
        The list of errors, which will not be null, but may be empty (if the write concern error is not null).
        Returns:
        the list of errors
      • getWriteConcernError

        public WriteConcernError getWriteConcernError()
        The write concern error, which may be null (in which case the list of errors will not be empty).
        Returns:
        the write concern error
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object