Package com.networknt.schema.resource
Class ResourceLoaders.Builder
java.lang.Object
com.networknt.schema.resource.ResourceLoaders.Builder
- Enclosing class:
ResourceLoaders
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(ResourceLoader resourceLoader) Adds a resource loader.build()Builds aResourceLoaders.Sets the resource data by absolute IRI function.Sets the resource data by using two mapping functions.Sets the resource data by absolute IRI.values(Consumer<List<ResourceLoader>> customizer) Customize the resource loaders.with(ResourceLoaders.Builder builder)
-
Constructor Details
-
Builder
public Builder() -
Builder
-
-
Method Details
-
with
-
values
Customize the resource loaders.- Parameters:
customizer- the customizer- Returns:
- the builder
-
add
Adds a resource loader.- Parameters:
resourceLoader- the resource loader- Returns:
- the builder
-
resources
Sets the resource data by absolute IRI.- Parameters:
resources- the map of IRI to resource data- Returns:
- the builder
-
resources
Sets the resource data by absolute IRI function.- Parameters:
resources- the function that returns resource data given IRI- Returns:
- the builder
-
resources
public <T> ResourceLoaders.Builder resources(Function<String, T> mapIriToObject, Function<T, String> mapObjectToData) Sets the resource 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 aResourceLoaders.- Returns:
- the resource loaders
-