Interface SchemaClient

  • All Superinterfaces:
    java.util.function.Function<java.lang.String,​java.io.InputStream>
    All Known Implementing Classes:
    DefaultSchemaClient
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface SchemaClient
    extends java.util.function.Function<java.lang.String,​java.io.InputStream>
    This interface is used by SchemaLoader to fetch the contents denoted by remote JSON pointer.

    Implementations are expected to support the HTTP/1.1 protocol, the support of other protocols is optional.

    • Method Summary

      Modifier and Type Method Description
      default java.io.InputStream apply​(java.lang.String url)  
      static SchemaClient classPathAwareClient()  
      java.io.InputStream get​(java.lang.String url)
      Returns a stream to be used for reading the remote content (response body) of the URL.
      • Methods inherited from interface java.util.function.Function

        andThen, compose
    • Method Detail

      • classPathAwareClient

        static SchemaClient classPathAwareClient()
      • apply

        default java.io.InputStream apply​(java.lang.String url)
        Specified by:
        apply in interface java.util.function.Function<java.lang.String,​java.io.InputStream>
      • get

        java.io.InputStream get​(java.lang.String url)
        Returns a stream to be used for reading the remote content (response body) of the URL. In the case of a HTTP URL, implementations are expected send HTTP GET requests and the response is expected to be represented in UTF-8 character set.
        Parameters:
        url - the URL of the remote resource
        Returns:
        the input stream of the response
        Throws:
        java.io.UncheckedIOException - if an IO error occurs.