public static class TypedJsonSchemaObject.StringJsonSchemaObject extends TypedJsonSchemaObject
JsonSchemaObject implementation of type : 'string' schema elements.schema objects.TypedJsonSchemaObject.ArrayJsonSchemaObject, TypedJsonSchemaObject.BooleanJsonSchemaObject, TypedJsonSchemaObject.NumericJsonSchemaObject, TypedJsonSchemaObject.ObjectJsonSchemaObject, TypedJsonSchemaObject.StringJsonSchemaObjectJsonSchemaObject.Typetypesdescription, generateDescription, restrictions| Modifier and Type | Method and Description |
|---|---|
TypedJsonSchemaObject.StringJsonSchemaObject |
allOf(Collection<JsonSchemaObject> allOf)
The field value must match all specified schemas.
|
TypedJsonSchemaObject.StringJsonSchemaObject |
anyOf(Collection<JsonSchemaObject> anyOf)
The field value must match at least one of the specified schemas.
|
TypedJsonSchemaObject.StringJsonSchemaObject |
description(String description)
Set the description.
|
TypedJsonSchemaObject.StringJsonSchemaObject |
generatedDescription()
Auto generate the description if not explicitly set.
|
protected String |
generateDescription()
Customization hook for creating description out of defined values.
|
TypedJsonSchemaObject.StringJsonSchemaObject |
length(Range<Integer> range)
Define the valid length range (minLength and maxLength) for a valid field.
|
TypedJsonSchemaObject.StringJsonSchemaObject |
matching(String pattern)
Define the regex pattern to validate field values against.
|
TypedJsonSchemaObject.StringJsonSchemaObject |
maxLength(int length)
Define the valid length range (maxLength) for a valid field.
|
TypedJsonSchemaObject.StringJsonSchemaObject |
minLength(int length)
Define the valid length range (minLength) for a valid field.
|
TypedJsonSchemaObject.StringJsonSchemaObject |
notMatch(JsonSchemaObject notMatch)
The field value must not match the specified schemas.
|
TypedJsonSchemaObject.StringJsonSchemaObject |
oneOf(Collection<JsonSchemaObject> oneOf)
The field value must match exactly one of the specified schemas.
|
TypedJsonSchemaObject.StringJsonSchemaObject |
possibleValues(Collection<? extends Object> possibleValues)
enumerates all possible values of the field.
|
org.bson.Document |
toDocument()
Create the JSON schema complying
Document representation. |
getTypes, ofnewInstancepublic TypedJsonSchemaObject.StringJsonSchemaObject length(Range<Integer> range)
range - must not be null.TypedJsonSchemaObject.StringJsonSchemaObject.public TypedJsonSchemaObject.StringJsonSchemaObject minLength(int length)
length - TypedJsonSchemaObject.StringJsonSchemaObject.public TypedJsonSchemaObject.StringJsonSchemaObject maxLength(int length)
length - TypedJsonSchemaObject.StringJsonSchemaObject.public TypedJsonSchemaObject.StringJsonSchemaObject matching(String pattern)
pattern - must not be null.TypedJsonSchemaObject.StringJsonSchemaObject.public TypedJsonSchemaObject.StringJsonSchemaObject possibleValues(Collection<? extends Object> possibleValues)
TypedJsonSchemaObjectpossibleValues in class TypedJsonSchemaObjectpossibleValues - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject.StringJsonSchemaObject allOf(Collection<JsonSchemaObject> allOf)
TypedJsonSchemaObjectallOf in class TypedJsonSchemaObjectallOf - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject.StringJsonSchemaObject anyOf(Collection<JsonSchemaObject> anyOf)
TypedJsonSchemaObjectanyOf in class TypedJsonSchemaObjectanyOf - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject.StringJsonSchemaObject oneOf(Collection<JsonSchemaObject> oneOf)
TypedJsonSchemaObjectoneOf in class TypedJsonSchemaObjectoneOf - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject.StringJsonSchemaObject notMatch(JsonSchemaObject notMatch)
TypedJsonSchemaObjectnotMatch in class TypedJsonSchemaObjectnotMatch - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject.StringJsonSchemaObject description(String description)
TypedJsonSchemaObjectdescription in class TypedJsonSchemaObjectdescription - must not be null.TypedJsonSchemaObject.public TypedJsonSchemaObject.StringJsonSchemaObject generatedDescription()
TypedJsonSchemaObjectgeneratedDescription in class TypedJsonSchemaObjectTypedJsonSchemaObject.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.