Class MapSchemaIdResolver

java.lang.Object
com.networknt.schema.resource.MapSchemaIdResolver
All Implemented Interfaces:
SchemaIdResolver

public class MapSchemaIdResolver extends Object implements SchemaIdResolver
Map implementation of SchemaIdResolver.
  • Constructor Details

    • MapSchemaIdResolver

      public MapSchemaIdResolver(Map<String,String> mappings)
    • MapSchemaIdResolver

      public MapSchemaIdResolver(Function<String,String> mappings)
    • MapSchemaIdResolver

      public MapSchemaIdResolver(Predicate<String> test, Function<String,String> mappings)
      Apply the mapping function if the predicate is true.
      Parameters:
      test - the predicate
      mappings - the mapping
  • Method Details

    • resolve

      public AbsoluteIri resolve(AbsoluteIri absoluteIRI)
      Description copied from interface: SchemaIdResolver
      Resolves a schema $id indicated by an absolute IRI to a retrieval IRI.
      Specified by:
      resolve in interface SchemaIdResolver
      Parameters:
      absoluteIRI - the $id of the schema
      Returns:
      the retrieval IRI or null if this resolver doesn't support the mapping