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 java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private SchemaMappers
values
-
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(java.util.function.Function<java.lang.String,java.lang.String> mappings)
Sets the function that maps the IRI to another IRI.SchemaMappers.Builder
mappings(java.util.function.Predicate<java.lang.String> test, java.util.function.Function<java.lang.String,java.lang.String> mappings)
Sets the function that maps the IRI to another IRI if the predicate is true.SchemaMappers.Builder
mappings(java.util.Map<java.lang.String,java.lang.String> mappings)
Sets the mappings.SchemaMappers.Builder
mapPrefix(java.lang.String source, java.lang.String replacement)
Maps a schema given a source prefix with a replacement.SchemaMappers.Builder
values(java.util.function.Consumer<java.util.List<SchemaMapper>> customizer)
Customize the schema mappers.SchemaMappers.Builder
with(SchemaMappers.Builder builder)
-
-
-
Field Detail
-
values
private final SchemaMappers values
-
-
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(java.util.function.Consumer<java.util.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(java.lang.String source, java.lang.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(java.util.Map<java.lang.String,java.lang.String> mappings)
Sets the mappings.- Parameters:
mappings
- the mappings- Returns:
- the builder
-
mappings
public SchemaMappers.Builder mappings(java.util.function.Function<java.lang.String,java.lang.String> mappings)
Sets the function that maps the IRI to another IRI.- Parameters:
mappings
- the mappings- Returns:
- the builder
-
mappings
public SchemaMappers.Builder mappings(java.util.function.Predicate<java.lang.String> test, java.util.function.Function<java.lang.String,java.lang.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
-
-