Package io.vertx.ext.mongo
Class ValidationOptions
- java.lang.Object
-
- io.vertx.ext.mongo.ValidationOptions
-
public final class ValidationOptions extends Object
-
-
Constructor Summary
Constructors Constructor Description ValidationOptions()
ValidationOptions(JsonObject json)
ValidationOptions(ValidationOptions validationOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
com.mongodb.client.model.ValidationAction
getValidationAction()
com.mongodb.client.model.ValidationLevel
getValidationLevel()
JsonObject
getValidator()
int
hashCode()
ValidationOptions
setValidationAction(com.mongodb.client.model.ValidationAction validationAction)
Optional.ValidationOptions
setValidationLevel(com.mongodb.client.model.ValidationLevel validationLevel)
Optional.ValidationOptions
setValidator(JsonObject validator)
Optional.JsonObject
toJson()
com.mongodb.client.model.ValidationOptions
toMongoDriverObject()
Returns the mongo-java-driver specific object.String
toString()
-
-
-
Constructor Detail
-
ValidationOptions
public ValidationOptions()
-
ValidationOptions
public ValidationOptions(ValidationOptions validationOptions)
-
ValidationOptions
public ValidationOptions(JsonObject json)
-
-
Method Detail
-
toJson
public JsonObject toJson()
-
toMongoDriverObject
public com.mongodb.client.model.ValidationOptions toMongoDriverObject()
Returns the mongo-java-driver specific object.- Returns:
- com.mongodb.client.model.ValidationOptions
-
getValidator
@Nullable public JsonObject getValidator()
-
setValidator
public ValidationOptions setValidator(@Nullable JsonObject validator)
Optional. Allows users to specify validation rules or expressions for the collection. For more information, see Schema Validation.- Parameters:
validator
-- Returns:
- ValidationOptions
-
getValidationLevel
@Nullable public com.mongodb.client.model.ValidationLevel getValidationLevel()
-
setValidationLevel
public ValidationOptions setValidationLevel(@Nullable com.mongodb.client.model.ValidationLevel validationLevel)
Optional. Determines how strictly MongoDB applies the validation rules to existing documents during an update.- Parameters:
validationLevel
-- Returns:
- ValidationOptions
-
getValidationAction
@Nullable public com.mongodb.client.model.ValidationAction getValidationAction()
-
setValidationAction
public ValidationOptions setValidationAction(@Nullable com.mongodb.client.model.ValidationAction validationAction)
Optional. Determines whether to error on invalid documents or just warn about the violations but allow invalid documents to be inserted.- Parameters:
validationAction
-- Returns:
- ValidationOptions
-
-