Package com.networknt.schema.resource
Class SchemaMappers.Builder
- java.lang.Object
-
- com.networknt.schema.resource.SchemaMappers.Builder
-
- Enclosing class:
- SchemaMappers
public static class SchemaMappers.Builder extends Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
Builder(SchemaMappers.Builder copy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SchemaMappers.Builder
add(SchemaMapper schemaMapper)
Adds a schema mapper.SchemaMappers
build()
Builds aSchemaMappers
SchemaMappers.Builder
mappings(Function<String,String> mappings)
Sets the function that maps the IRI to another IRI.SchemaMappers.Builder
mappings(Predicate<String> test, Function<String,String> mappings)
Sets the function that maps the IRI to another IRI if the predicate is true.SchemaMappers.Builder
mappings(Map<String,String> mappings)
Sets the mappings.SchemaMappers.Builder
mapPrefix(String source, String replacement)
Maps a schema given a source prefix with a replacement.SchemaMappers.Builder
values(Consumer<List<SchemaMapper>> customizer)
Customize the schema mappers.SchemaMappers.Builder
with(SchemaMappers.Builder builder)
-
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(SchemaMappers.Builder copy)
-
-
Method Detail
-
with
public SchemaMappers.Builder with(SchemaMappers.Builder builder)
-
values
public SchemaMappers.Builder values(Consumer<List<SchemaMapper>> customizer)
Customize the schema mappers.- Parameters:
customizer
- the customizer- Returns:
- the builder
-
add
public SchemaMappers.Builder add(SchemaMapper schemaMapper)
Adds a schema mapper.- Parameters:
schemaMapper
- the schema mapper- Returns:
- the builder
-
mapPrefix
public SchemaMappers.Builder mapPrefix(String source, String replacement)
Maps a schema given a source prefix with a replacement.- Parameters:
source
- the source prefixreplacement
- the replacement prefix- Returns:
- the builder
-
mappings
public SchemaMappers.Builder mappings(Map<String,String> mappings)
Sets the mappings.- Parameters:
mappings
- the mappings- Returns:
- the builder
-
mappings
public SchemaMappers.Builder mappings(Function<String,String> mappings)
Sets the function that maps the IRI to another IRI.- Parameters:
mappings
- the mappings- Returns:
- the builder
-
mappings
public SchemaMappers.Builder mappings(Predicate<String> test, Function<String,String> mappings)
Sets the function that maps the IRI to another IRI if the predicate is true.- Parameters:
test
- the predicatemappings
- the mappings- Returns:
- the builder
-
build
public SchemaMappers build()
Builds aSchemaMappers
- Returns:
- the schema mappers
-
-