Module methanol

Interface BodyDecoder.Factory

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T> BodyDecoder<T> create​(java.net.http.HttpResponse.BodySubscriber<T> downstream)
      Creates a BodyDecoder with the given downstream.
      <T> BodyDecoder<T> create​(java.net.http.HttpResponse.BodySubscriber<T> downstream, java.util.concurrent.Executor executor)
      Creates a BodyDecoder with the given downstream and executor.
      java.lang.String encoding()
      Returns the encoding used by BodyDecoders created by this factory.
      static java.util.Optional<BodyDecoder.Factory> getFactory​(java.lang.String encoding)
      Returns the factory registered for the given encoding, if any.
      static java.util.Map<java.lang.String,​BodyDecoder.Factory> installedBindings()
      Returns an immutable map that case-insensitively maps encodings to their corresponding registered factories.
      static java.util.List<BodyDecoder.Factory> installedFactories()
      Returns an immutable list of the registered factories.
    • Method Detail

      • encoding

        java.lang.String encoding()
        Returns the encoding used by BodyDecoders created by this factory.
      • create

        <T> BodyDecoder<T> create​(java.net.http.HttpResponse.BodySubscriber<T> downstream)
        Creates a BodyDecoder with the given downstream.
      • create

        <T> BodyDecoder<T> create​(java.net.http.HttpResponse.BodySubscriber<T> downstream,
                                  java.util.concurrent.Executor executor)
        Creates a BodyDecoder with the given downstream and executor.
      • installedFactories

        static java.util.List<BodyDecoder.Factory> installedFactories()
        Returns an immutable list of the registered factories.
        Throws:
        java.util.ServiceConfigurationError - if an error occurs while loading the registered factories
      • installedBindings

        static java.util.Map<java.lang.String,​BodyDecoder.Factory> installedBindings()
        Returns an immutable map that case-insensitively maps encodings to their corresponding registered factories. If more than one factory is registered for a given encoding, it is unspecified which one ends up being in the map. However, decoders provided by this module are guaranteed to be overridden by ones registered by other modules for the same encoding.
      • getFactory

        static java.util.Optional<BodyDecoder.Factory> getFactory​(java.lang.String encoding)
        Returns the factory registered for the given encoding, if any.