Module spring.data.mongodb
Interface JsonSchemaProperty
- All Superinterfaces:
JsonSchemaObject
- All Known Implementing Classes:
IdentifiableJsonSchemaProperty,IdentifiableJsonSchemaProperty.ArrayJsonSchemaProperty,IdentifiableJsonSchemaProperty.BooleanJsonSchemaProperty,IdentifiableJsonSchemaProperty.DateJsonSchemaProperty,IdentifiableJsonSchemaProperty.EncryptedJsonSchemaProperty,IdentifiableJsonSchemaProperty.NullJsonSchemaProperty,IdentifiableJsonSchemaProperty.NumericJsonSchemaProperty,IdentifiableJsonSchemaProperty.ObjectJsonSchemaProperty,IdentifiableJsonSchemaProperty.QueryableJsonSchemaProperty,IdentifiableJsonSchemaProperty.RequiredJsonSchemaProperty,IdentifiableJsonSchemaProperty.StringJsonSchemaProperty,IdentifiableJsonSchemaProperty.TimestampJsonSchemaProperty,IdentifiableJsonSchemaProperty.UntypedJsonSchemaProperty
A property or patternProperty within a
JsonSchemaObject of type : 'object'.- Since:
- 2.1
- Author:
- Christoph Strobl, Mark Paluch
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.springframework.data.mongodb.core.schema.JsonSchemaObject
JsonSchemaObject.Type -
Method Summary
Modifier and TypeMethodDescriptionCreates a newIdentifiableJsonSchemaProperty.ArrayJsonSchemaPropertywith given identifier oftype : 'array'.Creates a newIdentifiableJsonSchemaProperty.BooleanJsonSchemaPropertywith given identifier oftype : 'boolean'.Creates a newIdentifiableJsonSchemaProperty.DateJsonSchemaPropertywith given identifier oftype : 'date'.decimal128(String identifier) Creates a newIdentifiableJsonSchemaProperty.NumericJsonSchemaPropertywith given identifier ofbsonType : 'decimal128'.encrypted(JsonSchemaProperty property) Turns the given target property into anecryptedone.Creates a newIdentifiableJsonSchemaProperty.NumericJsonSchemaPropertywith given identifier ofbsonType : 'double'.The identifier can be either the property name or the regex expression properties have to match when used along withTypedJsonSchemaObject.ObjectJsonSchemaObject.patternProperties(JsonSchemaProperty...).Creates a newIdentifiableJsonSchemaProperty.NumericJsonSchemaPropertywith given identifier ofbsonType : 'int'.Creates a newIdentifiableJsonSchemaProperty.NumericJsonSchemaPropertywith given identifier ofbsonType : 'long'.default booleanstatic JsonSchemaPropertymerged(Collection<JsonSchemaProperty> properties) Merges multipleJsonSchemaPropertywith potentially different attributes into one.Obtain a builder to create aJsonSchemaProperty.Creates a newIdentifiableJsonSchemaProperty.BooleanJsonSchemaPropertywith given identifier oftype : 'null'.Creates a newIdentifiableJsonSchemaProperty.NumericJsonSchemaPropertywith given identifier oftype : 'number'.Creates a newIdentifiableJsonSchemaProperty.ObjectJsonSchemaPropertywith given identifier oftype : 'object'.static JsonSchemaPropertyCreates a newJsonSchemaPropertywith given identifier ofbsonType : 'objectId'.queryable(JsonSchemaProperty property, List<QueryCharacteristic> queries) Turns the given target property into aqueryableone, eg. for range encrypted properties.static JsonSchemaPropertyrequired(JsonSchemaProperty property) Turns the givenJsonSchemaPropertyinto a required on.Creates a newIdentifiableJsonSchemaProperty.StringJsonSchemaPropertywith given identifier oftype : 'string'.Creates a newIdentifiableJsonSchemaProperty.TimestampJsonSchemaPropertywith given identifier oftype : 'timestamp'.Creates a newIdentifiableJsonSchemaProperty.UntypedJsonSchemaPropertywith given identifier withouttype.Methods inherited from interface org.springframework.data.mongodb.core.schema.JsonSchemaObject
getTypes, toDocument
-
Method Details
-
getIdentifier
String getIdentifier()The identifier can be either the property name or the regex expression properties have to match when used along withTypedJsonSchemaObject.ObjectJsonSchemaObject.patternProperties(JsonSchemaProperty...).- Returns:
- never null.
-
isRequired
default boolean isRequired()- Returns:
- false by default.
- Since:
- 2.2
-
untyped
Creates a newIdentifiableJsonSchemaProperty.UntypedJsonSchemaPropertywith given identifier withouttype.- Parameters:
identifier- the property name or patternProperty regex. Must not be null nor empty.- Returns:
- new instance of
IdentifiableJsonSchemaProperty.UntypedJsonSchemaProperty.
-
encrypted
static IdentifiableJsonSchemaProperty.EncryptedJsonSchemaProperty encrypted(JsonSchemaProperty property) Turns the given target property into anecryptedone.- Parameters:
property- must not be null.- Returns:
- new instance of
IdentifiableJsonSchemaProperty.EncryptedJsonSchemaProperty. - Since:
- 2.2
-
queryable
static IdentifiableJsonSchemaProperty.QueryableJsonSchemaProperty queryable(JsonSchemaProperty property, List<QueryCharacteristic> queries) Turns the given target property into aqueryableone, eg. for range encrypted properties.- Parameters:
property- the queryable property. Must not be null.queries- predefined query characteristics.- Since:
- 4.5
-
string
Creates a newIdentifiableJsonSchemaProperty.StringJsonSchemaPropertywith given identifier oftype : 'string'.- Parameters:
identifier- the property name or patternProperty regex. Must not be null nor empty.- Returns:
- new instance of
IdentifiableJsonSchemaProperty.StringJsonSchemaProperty.
-
object
Creates a newIdentifiableJsonSchemaProperty.ObjectJsonSchemaPropertywith given identifier oftype : 'object'.- Parameters:
identifier- the property name or patternProperty regex. Must not be null nor empty.- Returns:
- new instance of
IdentifiableJsonSchemaProperty.ObjectJsonSchemaProperty.
-
objectId
Creates a newJsonSchemaPropertywith given identifier ofbsonType : 'objectId'.- Parameters:
identifier- the property name or patternProperty regex. Must not be null nor empty.- Returns:
- new instance of
JsonSchemaProperty. - Since:
- 2.2
-
number
Creates a newIdentifiableJsonSchemaProperty.NumericJsonSchemaPropertywith given identifier oftype : 'number'.- Parameters:
identifier- the property name or patternProperty regex. Must not be null nor empty.- Returns:
- new instance of
IdentifiableJsonSchemaProperty.NumericJsonSchemaProperty.
-
int32
Creates a newIdentifiableJsonSchemaProperty.NumericJsonSchemaPropertywith given identifier ofbsonType : 'int'.- Parameters:
identifier- the property name or patternProperty regex. Must not be null nor empty.- Returns:
- new instance of
IdentifiableJsonSchemaProperty.NumericJsonSchemaProperty.
-
int64
Creates a newIdentifiableJsonSchemaProperty.NumericJsonSchemaPropertywith given identifier ofbsonType : 'long'.- Parameters:
identifier- the property name or patternProperty regex. Must not be null nor empty.- Returns:
- new instance of
IdentifiableJsonSchemaProperty.NumericJsonSchemaProperty.
-
float64
Creates a newIdentifiableJsonSchemaProperty.NumericJsonSchemaPropertywith given identifier ofbsonType : 'double'.- Parameters:
identifier- the property name or patternProperty regex. Must not be null nor empty.- Returns:
- new instance of
IdentifiableJsonSchemaProperty.NumericJsonSchemaProperty.
-
decimal128
Creates a newIdentifiableJsonSchemaProperty.NumericJsonSchemaPropertywith given identifier ofbsonType : 'decimal128'.- Parameters:
identifier- the property name or patternProperty regex. Must not be null nor empty.- Returns:
- new instance of
IdentifiableJsonSchemaProperty.NumericJsonSchemaProperty.
-
array
Creates a newIdentifiableJsonSchemaProperty.ArrayJsonSchemaPropertywith given identifier oftype : 'array'.- Parameters:
identifier- the property name or patternProperty regex. Must not be null nor empty.- Returns:
- new instance of
IdentifiableJsonSchemaProperty.ArrayJsonSchemaProperty.
-
bool
Creates a newIdentifiableJsonSchemaProperty.BooleanJsonSchemaPropertywith given identifier oftype : 'boolean'.- Parameters:
identifier- the property name or patternProperty regex. Must not be null nor empty.- Returns:
- new instance of
IdentifiableJsonSchemaProperty.BooleanJsonSchemaProperty.
-
nil
Creates a newIdentifiableJsonSchemaProperty.BooleanJsonSchemaPropertywith given identifier oftype : 'null'.- Parameters:
identifier- the property name or patternProperty regex. Must not be null nor empty.- Returns:
- new instance of
IdentifiableJsonSchemaProperty.NullJsonSchemaProperty.
-
date
Creates a newIdentifiableJsonSchemaProperty.DateJsonSchemaPropertywith given identifier oftype : 'date'.- Parameters:
identifier- the property name or patternProperty regex. Must not be null nor empty.- Returns:
- new instance of
IdentifiableJsonSchemaProperty.DateJsonSchemaProperty.
-
timestamp
Creates a newIdentifiableJsonSchemaProperty.TimestampJsonSchemaPropertywith given identifier oftype : 'timestamp'.- Parameters:
identifier- the property name or patternProperty regex. Must not be null nor empty.- Returns:
- new instance of
IdentifiableJsonSchemaProperty.TimestampJsonSchemaProperty.
-
named
Obtain a builder to create aJsonSchemaProperty.- Parameters:
identifier- must not be null.- Returns:
- new instance of
JsonSchemaProperty.JsonSchemaPropertyBuilder.
-
required
Turns the givenJsonSchemaPropertyinto a required on.- Parameters:
property- must not be null.- Returns:
- new instance of
JsonSchemaProperty. - Since:
- 2.2
-
merged
Merges multipleJsonSchemaPropertywith potentially different attributes into one.- Parameters:
properties- must not be null.- Returns:
- new instance of
JsonSchemaProperty. - Since:
- 3.4
-