Module spring.data.mongodb
Class MongoJsonSchema.MongoJsonSchemaBuilder
java.lang.Object
org.springframework.data.mongodb.core.schema.MongoJsonSchema.MongoJsonSchemaBuilder
- Enclosing interface:
- MongoJsonSchema
MongoJsonSchema.MongoJsonSchemaBuilder provides a fluent API for defining a MongoJsonSchema.- Author:
- Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionadditionalProperties(boolean additionalPropertiesAllowed) allOf(Set<JsonSchemaObject> allOf) anyOf(Set<JsonSchemaObject> anyOf) build()Obtain theMongoJsonSchema.description(String description) voidencryptionMetadata(org.bson.Document encryptionMetadata) Define the encryptMetadata element of the schema.maxProperties(int count) minProperties(int count) notMatch(JsonSchemaObject notMatch) oneOf(Set<JsonSchemaObject> oneOf) patternProperties(JsonSchemaProperty... properties) possibleValues(Set<Object> possibleValues) properties(JsonSchemaProperty... properties) property(JsonSchemaProperty property)
-
Method Details
-
minProperties
- Parameters:
count-- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
maxProperties
- Parameters:
count-- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
required
- Parameters:
properties- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
additionalProperties
public MongoJsonSchema.MongoJsonSchemaBuilder additionalProperties(boolean additionalPropertiesAllowed) - Parameters:
additionalPropertiesAllowed-- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
additionalProperties
public MongoJsonSchema.MongoJsonSchemaBuilder additionalProperties(TypedJsonSchemaObject.ObjectJsonSchemaObject schema) - Parameters:
schema- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
properties
- Parameters:
properties- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
patternProperties
- Parameters:
properties- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
property
- Parameters:
property- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
possibleValues
- Parameters:
possibleValues- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
allOf
- Parameters:
allOf- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
anyOf
- Parameters:
anyOf- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
oneOf
- Parameters:
oneOf- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
notMatch
- Parameters:
notMatch- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
description
- Parameters:
description- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
encryptionMetadata
Define the encryptMetadata element of the schema.- Parameters:
encryptionMetadata- can be null.- Since:
- 3.3
-
build
Obtain theMongoJsonSchema.- Returns:
- new instance of
MongoJsonSchema.
-