Package org.dizitart.no2.collection
Class UpdateOptions
- java.lang.Object
-
- org.dizitart.no2.collection.UpdateOptions
-
public class UpdateOptions extends Object
Represents options to configure update operation.- Since:
- 1.0
- Author:
- Anindya Chatterjee
- See Also:
NitriteCollection.update(Filter, Document, UpdateOptions)
-
-
Constructor Summary
Constructors Constructor Description UpdateOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
boolean
isInsertIfAbsent()
Indicates if the update operation will insert a new document if it does not find any existing document to update.boolean
isJustOnce()
Indicates if only one document will be updated or all of them.void
setInsertIfAbsent(boolean insertIfAbsent)
Indicates if the update operation will insert a new document if it does not find any existing document to update.void
setJustOnce(boolean justOnce)
Indicates if only one document will be updated or all of them.String
toString()
static UpdateOptions
updateOptions(boolean insertIfAbsent)
Creates a newUpdateOptions
.static UpdateOptions
updateOptions(boolean insertIfAbsent, boolean justOnce)
Creates a newUpdateOptions
.
-
-
-
Method Detail
-
updateOptions
public static UpdateOptions updateOptions(boolean insertIfAbsent)
Creates a newUpdateOptions
.- Parameters:
insertIfAbsent
- the insertIfAbsent flag- Returns:
- the
UpdateOptions
.
-
updateOptions
public static UpdateOptions updateOptions(boolean insertIfAbsent, boolean justOnce)
Creates a newUpdateOptions
.- Parameters:
insertIfAbsent
- the insertIfAbsent flagjustOnce
- the justOnce flag- Returns:
- the
UpdateOptions
.
-
isInsertIfAbsent
public boolean isInsertIfAbsent()
Indicates if the update operation will insert a new document if it does not find any existing document to update.
-
setInsertIfAbsent
public void setInsertIfAbsent(boolean insertIfAbsent)
Indicates if the update operation will insert a new document if it does not find any existing document to update.
-
isJustOnce
public boolean isJustOnce()
Indicates if only one document will be updated or all of them.
-
setJustOnce
public void setJustOnce(boolean justOnce)
Indicates if only one document will be updated or all of them.
-
-