Class SchemaDocument.Builder
- java.lang.Object
-
- software.amazon.smithy.jsonschema.SchemaDocument.Builder
-
- All Implemented Interfaces:
SmithyBuilder<SchemaDocument>
- Enclosing class:
- SchemaDocument
public static final class SchemaDocument.Builder extends java.lang.Object implements SmithyBuilder<SchemaDocument>
Builds a JSON Schema document.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SchemaDocument
build()
Creates an immutable object that is created from the properties that have been set on the builder.SchemaDocument.Builder
extensions(ObjectNode extensions)
Adds custom key-value pairs to the resulting JSON Schema document.SchemaDocument.Builder
idKeyword(java.lang.String idKeyword)
Sets the "$id" keyword.SchemaDocument.Builder
putDefinition(java.lang.String name, Schema schema)
Adds a scheme definition to the builder.SchemaDocument.Builder
removeDefinition(java.lang.String name)
Removes a schema definition by name.SchemaDocument.Builder
rootSchema(Schema rootSchema)
Sets the root schema.SchemaDocument.Builder
schemaKeyword(java.lang.String schemaKeyword)
Sets the "$schema" keyword.
-
-
-
Method Detail
-
build
public SchemaDocument 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<SchemaDocument>
- Returns:
- an instance of T
-
idKeyword
public SchemaDocument.Builder idKeyword(java.lang.String idKeyword)
Sets the "$id" keyword.- Parameters:
idKeyword
- ID keyword URI to set.- Returns:
- Returns the builder.
-
schemaKeyword
public SchemaDocument.Builder schemaKeyword(java.lang.String schemaKeyword)
Sets the "$schema" keyword.- Parameters:
schemaKeyword
- Schema keyword URI to set.- Returns:
- Returns the builder.
-
rootSchema
public SchemaDocument.Builder rootSchema(Schema rootSchema)
Sets the root schema.- Parameters:
rootSchema
- Root schema of the document.- Returns:
- Returns the builder.
-
putDefinition
public SchemaDocument.Builder putDefinition(java.lang.String name, Schema schema)
Adds a scheme definition to the builder.- Parameters:
name
- Name of the schema.schema
- Schema to associate to the name.- Returns:
- Returns the builder.
-
removeDefinition
public SchemaDocument.Builder removeDefinition(java.lang.String name)
Removes a schema definition by name.- Parameters:
name
- Name of the schema to remove.- Returns:
- Returns the builder.
-
extensions
public SchemaDocument.Builder extensions(ObjectNode extensions)
Adds custom key-value pairs to the resulting JSON Schema document.- Parameters:
extensions
- Extensions to apply.- Returns:
- Returns the builder.
-
-