Class SchemaLoaders.Builder

java.lang.Object
com.networknt.schema.resource.SchemaLoaders.Builder
Enclosing class:
SchemaLoaders

public static class SchemaLoaders.Builder extends Object
  • Constructor Details

  • Method Details

    • with

    • values

      public SchemaLoaders.Builder values(Consumer<List<SchemaLoader>> customizer)
      Customize the schema loaders.
      Parameters:
      customizer - the customizer
      Returns:
      the builder
    • add

      public SchemaLoaders.Builder add(SchemaLoader schemaLoader)
      Adds a schema loader.
      Parameters:
      schemaLoader - the schema loader
      Returns:
      the builder
    • schemas

      public SchemaLoaders.Builder schemas(Map<String,String> schemas)
      Sets the schema data by absolute IRI.
      Parameters:
      schemas - the map of IRI to schema data
      Returns:
      the builder
    • schemas

      public SchemaLoaders.Builder schemas(Function<String,String> 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 object
      mapObjectToData - the mappingof object to schema data
      Returns:
      the builder
    • build

      public SchemaLoaders build()
      Builds a SchemaLoaders.
      Returns:
      the schema loaders