Class ContentDecoder.Factory

All Implemented Interfaces:
Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle
Enclosing interface:
ContentDecoder

public abstract static class ContentDecoder.Factory extends ContainerLifeCycle

A factory for Content.Source that decode response content.

A Factory has an encoding and a weight that are used in the Accept-Encoding request header and in the Content-Encoding response headers.

Factory instances are configured in HttpClient via HttpClient.getContentDecoderFactories().

  • Constructor Details

    • Factory

      protected Factory(String encoding)
    • Factory

      protected Factory(String encoding, float weight)
  • Method Details

    • getEncoding

      public String getEncoding()
      Returns:
      the type of the decoders created by this factory
    • getWeight

      public float getWeight()
      Returns:
      the weight (between 0 and 1, at most 3 decimal digits) to use for the Accept-Encoding request header
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • newDecoderContentSource

      public abstract Content.Source newDecoderContentSource(Content.Source contentSource)

      Creates a Content.Source that decodes the chunks of the given Content.Source parameter.

      Parameters:
      contentSource - the encoded Content.Source
      Returns:
      the decoded Content.Source