Package io.vertx.ext.mongo
Class UpdateOptions
- java.lang.Object
-
- io.vertx.ext.mongo.UpdateOptions
-
public class UpdateOptions extends Object
Options for configuring updates.- Author:
- Nick Scavelli
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_MULTIThe default value of multi = falsestatic booleanDEFAULT_RETURN_NEW_DOCUMENTThe default value of returning new document = falsestatic booleanDEFAULT_UPSERTThe default value of upsert = false
-
Constructor Summary
Constructors Constructor Description UpdateOptions()Default constructorUpdateOptions(boolean upsert)Constructor specify upsertUpdateOptions(boolean upsert, boolean multi)Constructor specify upsert and multiUpdateOptions(JsonObject json)Constructor from JSONUpdateOptions(UpdateOptions other)Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)JsonArraygetArrayFilters()Get the arrayFilters option.CollationOptionsgetCollation()JsonObjectgetHint()Get the hint.StringgetHintString()Get the hint string.WriteOptiongetWriteOption()Get the write option.inthashCode()booleanisMulti()Get whether multi is enabled.booleanisReturningNewDocument()Get whether returning new document property is enabled.booleanisUpsert()Get whether upsert is enabledUpdateOptionssetArrayFilters(JsonArray arrayFilters)Set the arrayFilters optionUpdateOptionssetCollation(CollationOptions collation)Collation optionsUpdateOptionssetHint(JsonObject hint)Set the hint.UpdateOptionssetHintString(String hintString)Set the hint string.UpdateOptionssetMulti(boolean multi)Set whether multi is enabledUpdateOptionssetReturningNewDocument(boolean returnNewDocument)Set whether new document property is enabled.UpdateOptionssetUpsert(boolean upsert)Set whether upsert is enabledUpdateOptionssetWriteOption(WriteOption writeOption)Set the write optionJsonObjecttoJson()StringtoString()
-
-
-
Field Detail
-
DEFAULT_UPSERT
public static final boolean DEFAULT_UPSERT
The default value of upsert = false- See Also:
- Constant Field Values
-
DEFAULT_MULTI
public static final boolean DEFAULT_MULTI
The default value of multi = false- See Also:
- Constant Field Values
-
DEFAULT_RETURN_NEW_DOCUMENT
public static final boolean DEFAULT_RETURN_NEW_DOCUMENT
The default value of returning new document = false- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UpdateOptions
public UpdateOptions()
Default constructor
-
UpdateOptions
public UpdateOptions(boolean upsert)
Constructor specify upsert- Parameters:
upsert- the value of upsert
-
UpdateOptions
public UpdateOptions(boolean upsert, boolean multi)Constructor specify upsert and multi- Parameters:
upsert- the value of upsertmulti- the value of multi
-
UpdateOptions
public UpdateOptions(UpdateOptions other)
Copy constructor- Parameters:
other- the one to copy
-
UpdateOptions
public UpdateOptions(JsonObject json)
Constructor from JSON- Parameters:
json- the json
-
-
Method Detail
-
getCollation
public CollationOptions getCollation()
-
setCollation
public UpdateOptions setCollation(CollationOptions collation)
Collation options- Parameters:
collation-
-
getWriteOption
public WriteOption getWriteOption()
Get the write option.- Returns:
- the write option
-
setWriteOption
public UpdateOptions setWriteOption(WriteOption writeOption)
Set the write option- Parameters:
writeOption- the write option- Returns:
- reference to this, for fluency
-
isUpsert
public boolean isUpsert()
Get whether upsert is enabled- Returns:
- upsert is enabled?
-
setUpsert
public UpdateOptions setUpsert(boolean upsert)
Set whether upsert is enabled- Parameters:
upsert- true if enabled- Returns:
- reference to this, for fluency
-
isReturningNewDocument
public boolean isReturningNewDocument()
Get whether returning new document property is enabled. Valid only on findOneAnd* methods.- Returns:
- new document property is enabled?
-
setReturningNewDocument
public UpdateOptions setReturningNewDocument(boolean returnNewDocument)
Set whether new document property is enabled. Valid only on findOneAnd* methods.- Parameters:
returnNewDocument- true if enabled- Returns:
- reference to this, for fluency
-
isMulti
public boolean isMulti()
Get whether multi is enabled. Multi means more than one document can be updated.- Returns:
- multi is enabled?
-
setMulti
public UpdateOptions setMulti(boolean multi)
Set whether multi is enabled- Parameters:
multi- true if enabled- Returns:
- reference to this, for fluency
-
getArrayFilters
public JsonArray getArrayFilters()
Get the arrayFilters option.- Returns:
- the arrayFilters option
-
setArrayFilters
public UpdateOptions setArrayFilters(JsonArray arrayFilters)
Set the arrayFilters option- Parameters:
arrayFilters- the arrayFilters option- Returns:
- reference to this, for fluency
-
getHint
public JsonObject getHint()
Get the hint.- Returns:
- the hint
-
setHint
public UpdateOptions setHint(JsonObject hint)
Set the hint.- Parameters:
hint- the hint- Returns:
- reference to this, for fluency
-
getHintString
public String getHintString()
Get the hint string.- Returns:
- the hint string
-
setHintString
public UpdateOptions setHintString(String hintString)
Set the hint string.- Parameters:
hintString- the hint string- Returns:
- reference to this, for fluency
-
toJson
public JsonObject toJson()
-
-