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.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.ArrayJsonSchemaProperty
with given identifier oftype : 'array'
.Creates a newIdentifiableJsonSchemaProperty.BooleanJsonSchemaProperty
with given identifier oftype : 'boolean'
.Creates a newIdentifiableJsonSchemaProperty.DateJsonSchemaProperty
with given identifier oftype : 'date'
.decimal128
(String identifier) Creates a newIdentifiableJsonSchemaProperty.NumericJsonSchemaProperty
with given identifier ofbsonType : 'decimal128'
.encrypted
(JsonSchemaProperty property) Turns the given target property into anecrypted
one.Creates a newIdentifiableJsonSchemaProperty.NumericJsonSchemaProperty
with 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.NumericJsonSchemaProperty
with given identifier ofbsonType : 'int'
.Creates a newIdentifiableJsonSchemaProperty.NumericJsonSchemaProperty
with given identifier ofbsonType : 'long'
.default boolean
static JsonSchemaProperty
merged
(Collection<JsonSchemaProperty> properties) Merges multipleJsonSchemaProperty
with potentially different attributes into one.Obtain a builder to create aJsonSchemaProperty
.Creates a newIdentifiableJsonSchemaProperty.BooleanJsonSchemaProperty
with given identifier oftype : 'null'
.Creates a newIdentifiableJsonSchemaProperty.NumericJsonSchemaProperty
with given identifier oftype : 'number'
.Creates a newIdentifiableJsonSchemaProperty.ObjectJsonSchemaProperty
with given identifier oftype : 'object'
.static JsonSchemaProperty
Creates a newJsonSchemaProperty
with given identifier ofbsonType : 'objectId'
.static JsonSchemaProperty
required
(JsonSchemaProperty property) Turns the givenJsonSchemaProperty
into a required on.Creates a newIdentifiableJsonSchemaProperty.StringJsonSchemaProperty
with given identifier oftype : 'string'
.Creates a newIdentifiableJsonSchemaProperty.TimestampJsonSchemaProperty
with given identifier oftype : 'timestamp'
.Creates a newIdentifiableJsonSchemaProperty.UntypedJsonSchemaProperty
with 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.UntypedJsonSchemaProperty
with 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 anecrypted
one.- Parameters:
property
- must not be null.- Returns:
- new instance of
IdentifiableJsonSchemaProperty.EncryptedJsonSchemaProperty
. - Since:
- 2.2
-
string
Creates a newIdentifiableJsonSchemaProperty.StringJsonSchemaProperty
with 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.ObjectJsonSchemaProperty
with 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 newJsonSchemaProperty
with 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.NumericJsonSchemaProperty
with 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.NumericJsonSchemaProperty
with 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.NumericJsonSchemaProperty
with 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.NumericJsonSchemaProperty
with 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.NumericJsonSchemaProperty
with 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.ArrayJsonSchemaProperty
with 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.BooleanJsonSchemaProperty
with 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.BooleanJsonSchemaProperty
with 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.DateJsonSchemaProperty
with 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.TimestampJsonSchemaProperty
with 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 givenJsonSchemaProperty
into a required on.- Parameters:
property
- must not be null.- Returns:
- new instance of
JsonSchemaProperty
. - Since:
- 2.2
-
merged
Merges multipleJsonSchemaProperty
with potentially different attributes into one.- Parameters:
properties
- must not be null.- Returns:
- new instance of
JsonSchemaProperty
. - Since:
- 3.4
-