public static class TypedJsonSchemaObject.ObjectJsonSchemaObject extends TypedJsonSchemaObject
JsonSchemaObject implementation of type : 'object' schema elements.schema objects.TypedJsonSchemaObject.ArrayJsonSchemaObject, TypedJsonSchemaObject.BooleanJsonSchemaObject, TypedJsonSchemaObject.NumericJsonSchemaObject, TypedJsonSchemaObject.ObjectJsonSchemaObject, TypedJsonSchemaObject.StringJsonSchemaObjectJsonSchemaObject.Typetypesdescription, generateDescription, restrictions| Constructor and Description |
|---|
ObjectJsonSchemaObject() |
| Modifier and Type | Method and Description |
|---|---|
TypedJsonSchemaObject.ObjectJsonSchemaObject |
additionalProperties(boolean additionalPropertiesAllowed)
If set to false, additional fields besides
properties(JsonSchemaProperty...) |
TypedJsonSchemaObject.ObjectJsonSchemaObject |
additionalProperties(TypedJsonSchemaObject.ObjectJsonSchemaObject schema)
If specified, additional fields must validate against the given schema.
|
TypedJsonSchemaObject.ObjectJsonSchemaObject |
allOf(Collection<JsonSchemaObject> allOf)
The field value must match all specified schemas.
|
TypedJsonSchemaObject.ObjectJsonSchemaObject |
anyOf(Collection<JsonSchemaObject> anyOf)
The field value must match at least one of the specified schemas.
|
TypedJsonSchemaObject.ObjectJsonSchemaObject |
description(String description)
Set the description.
|
TypedJsonSchemaObject.ObjectJsonSchemaObject |
generatedDescription()
Auto generate the description if not explicitly set.
|
protected String |
generateDescription()
Customization hook for creating description out of defined values.
|
List<JsonSchemaProperty> |
getProperties() |
TypedJsonSchemaObject.ObjectJsonSchemaObject |
maxProperties(int count)
Define the maxProperties.
|
TypedJsonSchemaObject.ObjectJsonSchemaObject |
minProperties(int count)
Define the minProperties.
|
TypedJsonSchemaObject.ObjectJsonSchemaObject |
notMatch(JsonSchemaObject notMatch)
The field value must not match the specified schemas.
|
TypedJsonSchemaObject.ObjectJsonSchemaObject |
oneOf(Collection<JsonSchemaObject> oneOf)
The field value must match exactly one of the specified schemas.
|
TypedJsonSchemaObject.ObjectJsonSchemaObject |
patternProperties(JsonSchemaProperty... regularExpressions)
Append regular expression patterns along with the
JsonSchemaObject matching properties validating
against. |
TypedJsonSchemaObject.ObjectJsonSchemaObject |
possibleValues(Collection<? extends Object> possibleValues)
enumerates all possible values of the field.
|
TypedJsonSchemaObject.ObjectJsonSchemaObject |
properties(JsonSchemaProperty... properties)
Append the objects properties along with the
JsonSchemaObject validating against. |
TypedJsonSchemaObject.ObjectJsonSchemaObject |
propertiesCount(Range<Integer> range)
Define the minProperties and maxProperties via the given
Range. |
TypedJsonSchemaObject.ObjectJsonSchemaObject |
property(JsonSchemaProperty property)
Append the objects property along with the
JsonSchemaObject validating against. |
TypedJsonSchemaObject.ObjectJsonSchemaObject |
required(String... properties)
Define the Object’s required properties.
|
org.bson.Document |
toDocument()
Create the JSON schema complying
Document representation. |
getTypes, ofnewInstancepublic TypedJsonSchemaObject.ObjectJsonSchemaObject propertiesCount(Range<Integer> range)
Range.range bounds are not taken into account.range - must not be null. Consider Range.unbounded() instead.TypedJsonSchemaObject.ObjectJsonSchemaObject.public TypedJsonSchemaObject.ObjectJsonSchemaObject minProperties(int count)
count - the allowed minimal number of properties.TypedJsonSchemaObject.ObjectJsonSchemaObject.public TypedJsonSchemaObject.ObjectJsonSchemaObject maxProperties(int count)
count - the allowed maximum number of properties.TypedJsonSchemaObject.ObjectJsonSchemaObject.public TypedJsonSchemaObject.ObjectJsonSchemaObject required(String... properties)
properties - the names of required properties.TypedJsonSchemaObject.ObjectJsonSchemaObject.public TypedJsonSchemaObject.ObjectJsonSchemaObject additionalProperties(boolean additionalPropertiesAllowed)
properties(JsonSchemaProperty...)/patternProperties(JsonSchemaProperty...) are not allowed.additionalPropertiesAllowed - TypedJsonSchemaObject.ObjectJsonSchemaObject.public TypedJsonSchemaObject.ObjectJsonSchemaObject additionalProperties(TypedJsonSchemaObject.ObjectJsonSchemaObject schema)
schema - must not be null.TypedJsonSchemaObject.ObjectJsonSchemaObject.public TypedJsonSchemaObject.ObjectJsonSchemaObject properties(JsonSchemaProperty... properties)
JsonSchemaObject validating against.properties - must not be null.TypedJsonSchemaObject.ObjectJsonSchemaObject.public TypedJsonSchemaObject.ObjectJsonSchemaObject patternProperties(JsonSchemaProperty... regularExpressions)
JsonSchemaObject matching properties validating
against.regularExpressions - must not be null.TypedJsonSchemaObject.ObjectJsonSchemaObject.public TypedJsonSchemaObject.ObjectJsonSchemaObject property(JsonSchemaProperty property)
JsonSchemaObject validating against.property - must not be null.TypedJsonSchemaObject.ObjectJsonSchemaObject.public TypedJsonSchemaObject.ObjectJsonSchemaObject possibleValues(Collection<? extends Object> possibleValues)
TypedJsonSchemaObjectpossibleValues in class TypedJsonSchemaObjectpossibleValues - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject.ObjectJsonSchemaObject allOf(Collection<JsonSchemaObject> allOf)
TypedJsonSchemaObjectallOf in class TypedJsonSchemaObjectallOf - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject.ObjectJsonSchemaObject anyOf(Collection<JsonSchemaObject> anyOf)
TypedJsonSchemaObjectanyOf in class TypedJsonSchemaObjectanyOf - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject.ObjectJsonSchemaObject oneOf(Collection<JsonSchemaObject> oneOf)
TypedJsonSchemaObjectoneOf in class TypedJsonSchemaObjectoneOf - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject.ObjectJsonSchemaObject notMatch(JsonSchemaObject notMatch)
TypedJsonSchemaObjectnotMatch in class TypedJsonSchemaObjectnotMatch - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject.ObjectJsonSchemaObject description(String description)
TypedJsonSchemaObjectdescription in class TypedJsonSchemaObjectdescription - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject.ObjectJsonSchemaObject generatedDescription()
TypedJsonSchemaObjectgeneratedDescription in class TypedJsonSchemaObjectTypedJsonSchemaObject.public List<JsonSchemaProperty> getProperties()
public org.bson.Document toDocument()
TypedJsonSchemaObjectDocument representation. This includes type,
description and the fields of Restrictions#toDocument() if set.toDocument in interface JsonSchemaObjecttoDocument in class TypedJsonSchemaObjectprotected String generateDescription()
TypedJsonSchemaObjectTypedJsonSchemaObject.toDocument() when no explicit TypedJsonSchemaObject.description(java.lang.String) is set.generateDescription in class TypedJsonSchemaObjectCopyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.