public class UntypedJsonSchemaObject extends Object implements JsonSchemaObject
JsonSchemaObject with shared types and JsonSchemaObject.toDocument() implementation.
Schema objects are immutable. Calling methods to configure properties creates a new object instance.JsonSchemaObject.Type| Modifier and Type | Field and Description |
|---|---|
protected String |
description |
protected boolean |
generateDescription |
protected org.springframework.data.mongodb.core.schema.UntypedJsonSchemaObject.Restrictions |
restrictions |
| Modifier and Type | Method and Description |
|---|---|
UntypedJsonSchemaObject |
allOf(Collection<JsonSchemaObject> allOf)
The field value must match all specified schemas.
|
UntypedJsonSchemaObject |
anyOf(Collection<JsonSchemaObject> anyOf)
The field value must match at least one of the specified schemas.
|
UntypedJsonSchemaObject |
description(String description)
Set the description.
|
UntypedJsonSchemaObject |
generatedDescription()
Auto generate the description if not explicitly set.
|
protected String |
generateDescription()
Customization hook for creating description out of defined values.
|
Set<JsonSchemaObject.Type> |
getTypes()
Get the set of types defined for this schema element.
|
static UntypedJsonSchemaObject |
newInstance()
Create a new instance of
UntypedJsonSchemaObject. |
UntypedJsonSchemaObject |
notMatch(JsonSchemaObject notMatch)
The field value must not match the specified schemas.
|
UntypedJsonSchemaObject |
oneOf(Collection<JsonSchemaObject> oneOf)
The field value must match exactly one of the specified schemas.
|
UntypedJsonSchemaObject |
possibleValues(Collection<? extends Object> possibleValues)
enumerates all possible values of the field.
|
org.bson.Document |
toDocument()
Create the JSON schema complying
Document representation. |
protected final org.springframework.data.mongodb.core.schema.UntypedJsonSchemaObject.Restrictions restrictions
protected final boolean generateDescription
public static UntypedJsonSchemaObject newInstance()
UntypedJsonSchemaObject.UntypedJsonSchemaObject.public Set<JsonSchemaObject.Type> getTypes()
JsonSchemaObjectSet is likely to contain only one element in most cases.getTypes in interface JsonSchemaObjectpublic UntypedJsonSchemaObject description(String description)
description - must not be null.TypedJsonSchemaObject.public UntypedJsonSchemaObject generatedDescription()
TypedJsonSchemaObject.public UntypedJsonSchemaObject possibleValues(Collection<? extends Object> possibleValues)
possibleValues - must not be null.TypedJsonSchemaObject.public UntypedJsonSchemaObject allOf(Collection<JsonSchemaObject> allOf)
allOf - must not be null.TypedJsonSchemaObject.public UntypedJsonSchemaObject anyOf(Collection<JsonSchemaObject> anyOf)
anyOf - must not be null.TypedJsonSchemaObject.public UntypedJsonSchemaObject oneOf(Collection<JsonSchemaObject> oneOf)
oneOf - must not be null.TypedJsonSchemaObject.public UntypedJsonSchemaObject notMatch(JsonSchemaObject notMatch)
oneOf - must not be null.TypedJsonSchemaObject.public org.bson.Document toDocument()
Document representation. This includes type,
description and the fields of Restrictions#toDocument() if set.toDocument in interface JsonSchemaObject@Nullable protected String generateDescription()
toDocument() when no explicit description is set.Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.