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 booleanequals(Object o)intgetIndex()The index of the item in the bulk write operation with this error.inthashCode()StringtoString()-
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:
equalsin classWriteError
-
hashCode
public int hashCode()
- Overrides:
hashCodein classWriteError
-
toString
public String toString()
- Overrides:
toStringin classWriteError
-
-