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.- Since:
- 2.1
- 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(@Nullable 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
@Contract("_ -> this") public MongoJsonSchema.MongoJsonSchemaBuilder additionalProperties(boolean additionalPropertiesAllowed) - Parameters:
additionalPropertiesAllowed-- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
additionalProperties
@Contract("_ -> this") public MongoJsonSchema.MongoJsonSchemaBuilder additionalProperties(TypedJsonSchemaObject.ObjectJsonSchemaObject schema) - Parameters:
schema- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
properties
@Contract("_ -> this") public MongoJsonSchema.MongoJsonSchemaBuilder properties(JsonSchemaProperty... properties) - Parameters:
properties- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
patternProperties
@Contract("_ -> this") public MongoJsonSchema.MongoJsonSchemaBuilder patternProperties(JsonSchemaProperty... properties) - Parameters:
properties- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
property
@Contract("_ -> this") public MongoJsonSchema.MongoJsonSchemaBuilder property(JsonSchemaProperty property) - Parameters:
property- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
possibleValues
@Contract("_ -> this") public MongoJsonSchema.MongoJsonSchemaBuilder possibleValues(Set<Object> possibleValues) - Parameters:
possibleValues- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
allOf
@Contract("_ -> this") public MongoJsonSchema.MongoJsonSchemaBuilder allOf(Set<JsonSchemaObject> allOf) - Parameters:
allOf- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
anyOf
@Contract("_ -> this") public MongoJsonSchema.MongoJsonSchemaBuilder anyOf(Set<JsonSchemaObject> anyOf) - Parameters:
anyOf- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
oneOf
@Contract("_ -> this") public MongoJsonSchema.MongoJsonSchemaBuilder oneOf(Set<JsonSchemaObject> oneOf) - Parameters:
oneOf- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
notMatch
@Contract("_ -> this") public MongoJsonSchema.MongoJsonSchemaBuilder notMatch(JsonSchemaObject notMatch) - Parameters:
notMatch- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
description
@Contract("_ -> this") public MongoJsonSchema.MongoJsonSchemaBuilder description(String description) - Parameters:
description- must not be null.- Returns:
thisMongoJsonSchema.MongoJsonSchemaBuilder.- See Also:
-
encryptionMetadata
public void encryptionMetadata(@Nullable org.bson.Document encryptionMetadata) Define the encryptMetadata element of the schema.- Parameters:
encryptionMetadata- can be null.- Since:
- 3.3
-
build
Obtain theMongoJsonSchema.- Returns:
- new instance of
MongoJsonSchema.
-