Package io.vertx.mongo.client.model
Class ValidationOptions
- java.lang.Object
-
- io.vertx.mongo.client.model.ValidationOptions
-
public class ValidationOptions extends java.lang.Object
Validation options for documents being inserted or updated in a collection- Since:
- 3.2
- Since server release
- 3.2
- MongoDB documentation
- Create Collection
-
-
Constructor Summary
Constructors Constructor Description ValidationOptions()
ValidationOptions(JsonObject json)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValidationAction
getValidationAction()
Gets theValidationAction
.ValidationLevel
getValidationLevel()
Gets theValidationLevel
that determines how strictly MongoDB applies the validation rules to existing documents during an insert or update.JsonObject
getValidator()
Gets the validation rules if set or null.ValidationOptions
setValidationAction(ValidationAction validationAction)
Sets theValidationAction
that determines whether to error on invalid documents or just warn about the violations but allow invalid documents.ValidationOptions
setValidationLevel(ValidationLevel validationLevel)
Sets the validation level that determines how strictly MongoDB applies the validation rules to existing documents during an insert or update.ValidationOptions
setValidator(JsonObject validator)
Sets the validation rules for allJsonObject
toJson()
-
-
-
Constructor Detail
-
ValidationOptions
public ValidationOptions()
-
ValidationOptions
public ValidationOptions(JsonObject json)
-
-
Method Detail
-
toJson
public JsonObject toJson()
-
setValidator
public ValidationOptions setValidator(JsonObject validator)
Sets the validation rules for all- Parameters:
validator
- the validation rules- Returns:
- this
-
getValidator
public JsonObject getValidator()
Gets the validation rules if set or null.- Returns:
- the validation rules if set or null
-
setValidationLevel
public ValidationOptions setValidationLevel(ValidationLevel validationLevel)
Sets the validation level that determines how strictly MongoDB applies the validation rules to existing documents during an insert or update.- Parameters:
validationLevel
- the validation level- Returns:
- this
-
getValidationLevel
public ValidationLevel getValidationLevel()
Gets theValidationLevel
that determines how strictly MongoDB applies the validation rules to existing documents during an insert or update.- Returns:
- the ValidationLevel.
-
setValidationAction
public ValidationOptions setValidationAction(ValidationAction validationAction)
Sets theValidationAction
that determines whether to error on invalid documents or just warn about the violations but allow invalid documents.- Parameters:
validationAction
- the validation action- Returns:
- this
-
getValidationAction
public ValidationAction getValidationAction()
Gets theValidationAction
.- Returns:
- the ValidationAction.
-
-