Class Schema.Builder
- java.lang.Object
-
- software.amazon.smithy.jsonschema.Schema.Builder
-
- All Implemented Interfaces:
SmithyBuilder<Schema>
- Enclosing class:
- Schema
public static final class Schema.Builder extends java.lang.Object implements SmithyBuilder<Schema>
Abstract class used to build Schema components.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Schema.Builder
additionalProperties(Schema additionalProperties)
Schema.Builder
allOf(java.util.List<Schema> allOf)
Schema.Builder
anyOf(java.util.List<Schema> anyOf)
Schema
build()
Creates an immutable object that is created from the properties that have been set on the builder.Schema.Builder
comment(java.lang.String comment)
Schema.Builder
constValue(Node constValue)
Schema.Builder
contentEncoding(java.lang.String contentEncoding)
Schema.Builder
contentMediaType(java.lang.String contentMediaType)
Schema.Builder
defaultValue(Node defaultValue)
Schema.Builder
description(java.lang.String description)
Schema.Builder
disableProperty(java.lang.String propertyName)
Disables a specific JSON schema property by name.Schema.Builder
enumValues(java.util.Collection<java.lang.String> enumValues)
Schema.Builder
examples(Node examples)
Schema.Builder
exclusiveMaximum(java.lang.Number exclusiveMaximum)
Schema.Builder
exclusiveMinimum(java.lang.Number exclusiveMinimum)
Schema.Builder
extensions(java.util.Map<java.lang.String,Node> extensions)
Schema.Builder
format(java.lang.String format)
java.util.Optional<java.lang.String>
getFormat()
Schema.Builder
intEnumValues(java.util.Collection<java.lang.Integer> intEnumValues)
Schema.Builder
items(Schema items)
Schema.Builder
maximum(java.lang.Number maximum)
Schema.Builder
maxItems(java.lang.Integer maxItems)
Schema.Builder
maxLength(java.lang.Long maxLength)
Schema.Builder
maxProperties(java.lang.Integer maxProperties)
Schema.Builder
minimum(java.lang.Number minimum)
Schema.Builder
minItems(java.lang.Integer minItems)
Schema.Builder
minLength(java.lang.Long minLength)
Schema.Builder
minProperties(java.lang.Integer minProperties)
Schema.Builder
multipleOf(java.lang.Number multipleOf)
Schema.Builder
not(Schema not)
Schema.Builder
oneOf(java.util.List<Schema> oneOf)
Schema.Builder
pattern(java.lang.String pattern)
Schema.Builder
patternProperties(java.util.Map<java.lang.String,Schema> patternProperties)
Schema.Builder
properties(java.util.Map<java.lang.String,Schema> properties)
Schema.Builder
propertyNames(Schema propertyNames)
Schema.Builder
putExtension(java.lang.String key, ToNode value)
Schema.Builder
putPatternProperty(java.lang.String key, Schema value)
Schema.Builder
putProperty(java.lang.String key, Schema value)
Schema.Builder
readOnly(boolean readOnly)
Schema.Builder
ref(java.lang.String ref)
Schema.Builder
removeExtension(java.lang.String key)
Schema.Builder
removePatternProperty(java.lang.String key)
Schema.Builder
removeProperty(java.lang.String key)
Schema.Builder
required(java.util.Collection<java.lang.String> required)
Schema.Builder
title(java.lang.String title)
Schema.Builder
type(java.lang.String type)
Schema.Builder
uniqueItems(boolean uniqueItems)
Schema.Builder
writeOnly(boolean writeOnly)
-
-
-
Method Detail
-
build
public Schema build()
Description copied from interface:SmithyBuilder
Creates an immutable object that is created from the properties that have been set on the builder.- Specified by:
build
in interfaceSmithyBuilder<Schema>
- Returns:
- an instance of T
-
ref
public Schema.Builder ref(java.lang.String ref)
-
type
public Schema.Builder type(java.lang.String type)
-
defaultValue
public Schema.Builder defaultValue(Node defaultValue)
-
enumValues
public Schema.Builder enumValues(java.util.Collection<java.lang.String> enumValues)
-
intEnumValues
public Schema.Builder intEnumValues(java.util.Collection<java.lang.Integer> intEnumValues)
-
constValue
public Schema.Builder constValue(Node constValue)
-
multipleOf
public Schema.Builder multipleOf(java.lang.Number multipleOf)
-
maximum
public Schema.Builder maximum(java.lang.Number maximum)
-
exclusiveMaximum
public Schema.Builder exclusiveMaximum(java.lang.Number exclusiveMaximum)
-
minimum
public Schema.Builder minimum(java.lang.Number minimum)
-
exclusiveMinimum
public Schema.Builder exclusiveMinimum(java.lang.Number exclusiveMinimum)
-
maxLength
public Schema.Builder maxLength(java.lang.Long maxLength)
-
minLength
public Schema.Builder minLength(java.lang.Long minLength)
-
pattern
public Schema.Builder pattern(java.lang.String pattern)
-
items
public Schema.Builder items(Schema items)
-
maxItems
public Schema.Builder maxItems(java.lang.Integer maxItems)
-
minItems
public Schema.Builder minItems(java.lang.Integer minItems)
-
uniqueItems
public Schema.Builder uniqueItems(boolean uniqueItems)
-
maxProperties
public Schema.Builder maxProperties(java.lang.Integer maxProperties)
-
minProperties
public Schema.Builder minProperties(java.lang.Integer minProperties)
-
required
public Schema.Builder required(java.util.Collection<java.lang.String> required)
-
properties
public Schema.Builder properties(java.util.Map<java.lang.String,Schema> properties)
-
putProperty
public Schema.Builder putProperty(java.lang.String key, Schema value)
-
removeProperty
public Schema.Builder removeProperty(java.lang.String key)
-
additionalProperties
public Schema.Builder additionalProperties(Schema additionalProperties)
-
propertyNames
public Schema.Builder propertyNames(Schema propertyNames)
-
patternProperties
public Schema.Builder patternProperties(java.util.Map<java.lang.String,Schema> patternProperties)
-
putPatternProperty
public Schema.Builder putPatternProperty(java.lang.String key, Schema value)
-
removePatternProperty
public Schema.Builder removePatternProperty(java.lang.String key)
-
allOf
public Schema.Builder allOf(java.util.List<Schema> allOf)
-
anyOf
public Schema.Builder anyOf(java.util.List<Schema> anyOf)
-
oneOf
public Schema.Builder oneOf(java.util.List<Schema> oneOf)
-
not
public Schema.Builder not(Schema not)
-
title
public Schema.Builder title(java.lang.String title)
-
description
public Schema.Builder description(java.lang.String description)
-
getFormat
public java.util.Optional<java.lang.String> getFormat()
-
format
public Schema.Builder format(java.lang.String format)
-
readOnly
public Schema.Builder readOnly(boolean readOnly)
-
writeOnly
public Schema.Builder writeOnly(boolean writeOnly)
-
comment
public Schema.Builder comment(java.lang.String comment)
-
contentEncoding
public Schema.Builder contentEncoding(java.lang.String contentEncoding)
-
contentMediaType
public Schema.Builder contentMediaType(java.lang.String contentMediaType)
-
examples
public Schema.Builder examples(Node examples)
-
extensions
public Schema.Builder extensions(java.util.Map<java.lang.String,Node> extensions)
-
putExtension
public Schema.Builder putExtension(java.lang.String key, ToNode value)
-
removeExtension
public Schema.Builder removeExtension(java.lang.String key)
-
disableProperty
public Schema.Builder disableProperty(java.lang.String propertyName)
Disables a specific JSON schema property by name.- Parameters:
propertyName
- Property name to remove (e.g., "propertyNames").- Returns:
- Returns the builder.
-
-