Package com.networknt.schema.resource
Class SchemaLoaders.Builder
java.lang.Object
com.networknt.schema.resource.SchemaLoaders.Builder
- Enclosing class:
SchemaLoaders
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd
(SchemaLoader schemaLoader) Adds a schema loader.build()
Builds aSchemaLoaders
.Sets the schema data by absolute IRI function.Sets the schema data by using two mapping functions.Sets the schema data by absolute IRI.values
(Consumer<List<SchemaLoader>> customizer) Customize the schema loaders.with
(SchemaLoaders.Builder builder)
-
Constructor Details
-
Builder
public Builder() -
Builder
-
-
Method Details
-
with
-
values
Customize the schema loaders.- Parameters:
customizer
- the customizer- Returns:
- the builder
-
add
Adds a schema loader.- Parameters:
schemaLoader
- the schema loader- Returns:
- the builder
-
schemas
Sets the schema data by absolute IRI.- Parameters:
schemas
- the map of IRI to schema data- Returns:
- the builder
-
schemas
Sets the schema data by absolute IRI function.- Parameters:
schemas
- the function that returns schema data given IRI- Returns:
- the builder
-
schemas
public <T> SchemaLoaders.Builder schemas(Function<String, T> mapIriToObject, Function<T, String> mapObjectToData) Sets the schema data by using two mapping functions.Firstly to map the IRI to an object. If the object is null no mapping is performed.
Next to map the object to the schema data.
- Type Parameters:
T
- the type of the object- Parameters:
mapIriToObject
- the mapping of IRI to objectmapObjectToData
- the mappingof object to schema data- Returns:
- the builder
-
build
Builds aSchemaLoaders
.- Returns:
- the schema loaders
-