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.Builderadd(SchemaMapper schemaMapper)Adds a schema mapper.SchemaMappersbuild()Builds aSchemaMappersSchemaMappers.Buildermappings(Function<String,String> mappings)Sets the function that maps the IRI to another IRI.SchemaMappers.Buildermappings(Predicate<String> test, Function<String,String> mappings)Sets the function that maps the IRI to another IRI if the predicate is true.SchemaMappers.Buildermappings(Map<String,String> mappings)Sets the mappings.SchemaMappers.BuildermapPrefix(String source, String replacement)Maps a schema given a source prefix with a replacement.SchemaMappers.Buildervalues(Consumer<List<SchemaMapper>> customizer)Customize the schema mappers.SchemaMappers.Builderwith(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
-
-