Package com.mongodb.bulk
Class BulkWriteError
- java.lang.Object
-
- com.mongodb.WriteError
-
- com.mongodb.bulk.BulkWriteError
-
public class BulkWriteError extends WriteError
Represents an error for an item included in a bulk write operation, e.g. a duplicate key error- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description BulkWriteError(int code, String message, BsonDocument details, int index)
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
getIndex()
The index of the item in the bulk write operation with this error.int
hashCode()
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from class com.mongodb.WriteError
getCategory, getCode, getDetails, getMessage
-
-
-
-
Constructor Detail
-
BulkWriteError
public BulkWriteError(int code, String message, BsonDocument details, int index)
Constructs a new instance.- Parameters:
code
- the error codemessage
- the error messagedetails
- details about the errorindex
- the index of the item in the bulk write operation that had this error
-
-
Method Detail
-
getIndex
public int getIndex()
The index of the item in the bulk write operation with this error.- Returns:
- the index
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classWriteError
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classWriteError
-
toString
public String toString()
- Overrides:
toString
in classWriteError
-
-