public interface JsonSchemaObject
toDocument().
schema objects such as
string() or object(). For example:
JsonSchemaProperty.object("address").properties(JsonSchemaProperty.string("city").minLength(3));
| Modifier and Type | Interface and Description |
|---|---|
static interface |
JsonSchemaObject.Type
Type represents either a JSON schema type or a MongoDB specific bsonType.
|
| Modifier and Type | Method and Description |
|---|---|
static TypedJsonSchemaObject.ArrayJsonSchemaObject |
array()
Create a new
JsonSchemaObject of type : 'array'. |
static TypedJsonSchemaObject.BooleanJsonSchemaObject |
bool()
Create a new
JsonSchemaObject of type : 'boolean'. |
static org.springframework.data.mongodb.core.schema.TypedJsonSchemaObject.DateJsonSchemaObject |
date()
Create a new
JsonSchemaObject of type : 'date'. |
Set<JsonSchemaObject.Type> |
getTypes()
Get the set of types defined for this schema element.
|
static org.springframework.data.mongodb.core.schema.TypedJsonSchemaObject.NullJsonSchemaObject |
nil()
Create a new
JsonSchemaObject of type : 'null'. |
static TypedJsonSchemaObject.NumericJsonSchemaObject |
number()
Create a new
JsonSchemaObject of type : 'number'. |
static TypedJsonSchemaObject.ObjectJsonSchemaObject |
object()
Create a new
JsonSchemaObject of type : 'object'. |
static TypedJsonSchemaObject |
of(Class<?> type)
Create a new
JsonSchemaObject matching the given type. |
static TypedJsonSchemaObject |
of(JsonSchemaObject.Type type)
Create a new
JsonSchemaObject of given JsonSchemaObject.Type. |
static TypedJsonSchemaObject.StringJsonSchemaObject |
string()
Create a new
JsonSchemaObject of type : 'string'. |
static org.springframework.data.mongodb.core.schema.TypedJsonSchemaObject.TimestampJsonSchemaObject |
timestamp()
Create a new
JsonSchemaObject of type : 'timestamp'. |
org.bson.Document |
toDocument()
Get the MongoDB specific representation.
|
static UntypedJsonSchemaObject |
untyped()
Create a new
UntypedJsonSchemaObject. |
Set<JsonSchemaObject.Type> getTypes()
Set is likely to contain only one element in most cases.org.bson.Document toDocument()
Document through the mapping infrastructure.static TypedJsonSchemaObject.ObjectJsonSchemaObject object()
JsonSchemaObject of type : 'object'.static TypedJsonSchemaObject.StringJsonSchemaObject string()
JsonSchemaObject of type : 'string'.static TypedJsonSchemaObject.NumericJsonSchemaObject number()
JsonSchemaObject of type : 'number'.static TypedJsonSchemaObject.ArrayJsonSchemaObject array()
JsonSchemaObject of type : 'array'.static TypedJsonSchemaObject.BooleanJsonSchemaObject bool()
JsonSchemaObject of type : 'boolean'.static org.springframework.data.mongodb.core.schema.TypedJsonSchemaObject.NullJsonSchemaObject nil()
JsonSchemaObject of type : 'null'.static org.springframework.data.mongodb.core.schema.TypedJsonSchemaObject.DateJsonSchemaObject date()
JsonSchemaObject of type : 'date'.static org.springframework.data.mongodb.core.schema.TypedJsonSchemaObject.TimestampJsonSchemaObject timestamp()
JsonSchemaObject of type : 'timestamp'.static TypedJsonSchemaObject of(JsonSchemaObject.Type type)
JsonSchemaObject of given JsonSchemaObject.Type.static UntypedJsonSchemaObject untyped()
UntypedJsonSchemaObject.static TypedJsonSchemaObject of(@Nullable Class<?> type)
JsonSchemaObject matching the given type.type - Java class to create a JsonSchemaObject for. May be null to create
null type.IllegalArgumentException - if type is not supported.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.