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 booleanequals(Object o)inthashCode()booleanisInsertIfAbsent()Indicates if the update operation will insert a new document if it does not find any existing document to update.booleanisJustOnce()Indicates if only one document will be updated or all of them.voidsetInsertIfAbsent(boolean insertIfAbsent)Indicates if the update operation will insert a new document if it does not find any existing document to update.voidsetJustOnce(boolean justOnce)Indicates if only one document will be updated or all of them.StringtoString()static UpdateOptionsupdateOptions(boolean insertIfAbsent)Creates a newUpdateOptions.static UpdateOptionsupdateOptions(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.
-
-