Class IdentifiableJsonSchemaProperty.RequiredJsonSchemaProperty
java.lang.Object
org.springframework.data.mongodb.core.schema.IdentifiableJsonSchemaProperty.RequiredJsonSchemaProperty
- All Implemented Interfaces:
JsonSchemaObject
,JsonSchemaProperty
- Enclosing class:
- IdentifiableJsonSchemaProperty<T extends JsonSchemaObject>
public static class IdentifiableJsonSchemaProperty.RequiredJsonSchemaProperty
extends Object
implements JsonSchemaProperty
Delegating
JsonSchemaProperty
implementation having a required flag for evaluation during schema
creation process.- Since:
- 2.2
- Author:
- Christoph Strobl
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.schema.JsonSchemaObject
JsonSchemaObject.Type
Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.schema.JsonSchemaProperty
JsonSchemaProperty.JsonSchemaPropertyBuilder
-
Method Summary
Modifier and TypeMethodDescriptionThe identifier can be either the property name or the regex expression properties have to match when used along withTypedJsonSchemaObject.ObjectJsonSchemaObject.patternProperties(JsonSchemaProperty...)
.getTypes()
Get the set of types defined for this schema element.
TheSet
is likely to contain only one element in most cases.boolean
org.bson.Document
Get the MongoDB specific representation.
The Document may contain fields (eg. like bsonType) not contained in the JsonSchema specification.
-
Method Details
-
getIdentifier
Description copied from interface:JsonSchemaProperty
The identifier can be either the property name or the regex expression properties have to match when used along withTypedJsonSchemaObject.ObjectJsonSchemaObject.patternProperties(JsonSchemaProperty...)
.- Specified by:
getIdentifier
in interfaceJsonSchemaProperty
- Returns:
- never null.
-
getTypes
Description copied from interface:JsonSchemaObject
Get the set of types defined for this schema element.
TheSet
is likely to contain only one element in most cases.- Specified by:
getTypes
in interfaceJsonSchemaObject
- Returns:
- never null.
-
toDocument
public org.bson.Document toDocument()Description copied from interface:JsonSchemaObject
Get the MongoDB specific representation.
The Document may contain fields (eg. like bsonType) not contained in the JsonSchema specification. It may also contain types not directly processable by the MongoDB java driver. Make sure to run the producedDocument
through the mapping infrastructure.- Specified by:
toDocument
in interfaceJsonSchemaObject
- Returns:
- never null.
-
isRequired
public boolean isRequired()- Specified by:
isRequired
in interfaceJsonSchemaProperty
- Returns:
- false by default.
-