Package com.mongodb
Class BulkWriteError
- java.lang.Object
-
- com.mongodb.BulkWriteError
-
public class BulkWriteError extends Object
Represents an error for an item included in a bulk write operation, e.g. a duplicate key error- Since:
- 2.12
- MongoDB documentation
- BulkWriteResult.writeErrors
- Since server release
- 2.6
-
-
Constructor Summary
Constructors Constructor Description BulkWriteError(int code, String message, DBObject details, int index)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetCode()Gets the code associated with this error.DBObjectgetDetails()Gets the details associated with this error.intgetIndex()The index of the item in the bulk write operation with this error.StringgetMessage()Gets the message associated with this error.inthashCode()StringtoString()
-
-
-
Method Detail
-
getCode
public int getCode()
Gets the code associated with this error.- Returns:
- the code
-
getMessage
public String getMessage()
Gets the message associated with this error.- Returns:
- the message
-
getDetails
public DBObject getDetails()
Gets the details associated with this error. This document will not be null, but may be empty.- Returns:
- the details
-
getIndex
public int getIndex()
The index of the item in the bulk write operation with this error.- Returns:
- the index
-
-