public class TypedJsonSchemaObject extends UntypedJsonSchemaObject
JsonSchemaObject of a given JsonSchemaObject.Type.| Modifier and Type | Class and Description |
|---|---|
static class |
TypedJsonSchemaObject.ArrayJsonSchemaObject
JsonSchemaObject implementation of type : 'array' schema elements. |
static class |
TypedJsonSchemaObject.BooleanJsonSchemaObject
JsonSchemaObject implementation of type : 'boolean' schema elements. |
static class |
TypedJsonSchemaObject.NumericJsonSchemaObject
JsonSchemaObject implementation of type : 'number', bsonType : 'int',
bsonType : 'long', bsonType : 'double' and bsonType : 'decimal128' schema elements. |
static class |
TypedJsonSchemaObject.ObjectJsonSchemaObject
JsonSchemaObject implementation of type : 'object' schema elements. |
static class |
TypedJsonSchemaObject.StringJsonSchemaObject
JsonSchemaObject implementation of type : 'string' schema elements. |
JsonSchemaObject.Type| Modifier and Type | Field and Description |
|---|---|
protected Set<JsonSchemaObject.Type> |
types |
description, generateDescription, restrictions| Modifier and Type | Method and Description |
|---|---|
TypedJsonSchemaObject |
allOf(Collection<JsonSchemaObject> allOf)
The field value must match all specified schemas.
|
TypedJsonSchemaObject |
anyOf(Collection<JsonSchemaObject> anyOf)
The field value must match at least one of the specified schemas.
|
TypedJsonSchemaObject |
description(String description)
Set the description.
|
TypedJsonSchemaObject |
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.
|
TypedJsonSchemaObject |
notMatch(JsonSchemaObject notMatch)
The field value must not match the specified schemas.
|
static TypedJsonSchemaObject |
of(JsonSchemaObject.Type... types)
Creates new
TypedJsonSchemaObject of given types. |
TypedJsonSchemaObject |
oneOf(Collection<JsonSchemaObject> oneOf)
The field value must match exactly one of the specified schemas.
|
TypedJsonSchemaObject |
possibleValues(Collection<? extends Object> possibleValues)
enumerates all possible values of the field.
|
org.bson.Document |
toDocument()
Create the JSON schema complying
Document representation. |
newInstanceprotected final Set<JsonSchemaObject.Type> types
public static TypedJsonSchemaObject of(JsonSchemaObject.Type... types)
TypedJsonSchemaObject of given types.types - must not be null.public Set<JsonSchemaObject.Type> getTypes()
JsonSchemaObjectSet is likely to contain only one element in most cases.getTypes in interface JsonSchemaObjectgetTypes in class UntypedJsonSchemaObjectpublic TypedJsonSchemaObject description(String description)
description in class UntypedJsonSchemaObjectdescription - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject generatedDescription()
generatedDescription in class UntypedJsonSchemaObjectTypedJsonSchemaObject.public TypedJsonSchemaObject possibleValues(Collection<? extends Object> possibleValues)
possibleValues in class UntypedJsonSchemaObjectpossibleValues - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject allOf(Collection<JsonSchemaObject> allOf)
allOf in class UntypedJsonSchemaObjectallOf - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject anyOf(Collection<JsonSchemaObject> anyOf)
anyOf in class UntypedJsonSchemaObjectanyOf - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject oneOf(Collection<JsonSchemaObject> oneOf)
oneOf in class UntypedJsonSchemaObjectoneOf - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject notMatch(JsonSchemaObject notMatch)
notMatch in class UntypedJsonSchemaObjectnotMatch - 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 JsonSchemaObjecttoDocument in class UntypedJsonSchemaObject@Nullable protected String generateDescription()
toDocument() when no explicit description(java.lang.String) is set.generateDescription in class UntypedJsonSchemaObjectCopyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.