Interface ContentEncodingContext

All Superinterfaces:
RuntimeType.Api<ContentEncodingContextConfig>

public interface ContentEncodingContext extends RuntimeType.Api<ContentEncodingContextConfig>
Content encoding support to obtain encoders and decoders.
  • Method Details

    • create

      static ContentEncodingContext create()
      Create a new encoding support.
      Returns:
      content encoding support
    • create

      static ContentEncodingContext create(Config config)
      Create a new encoding support and apply provided configuration.
      Parameters:
      config - configuration to use
      Returns:
      content encoding support
    • create

      Create content encoding context from its prototype.
      Parameters:
      config - content encoding context configuration
      Returns:
      a new content encoding context
    • create

      Create media context, customizing its configuration.
      Parameters:
      consumer - consumer of media context builder
      Returns:
      a new media context
    • builder

      Builder to set up this encoding support context.
      Returns:
      a new builder
    • contentEncodingEnabled

      boolean contentEncodingEnabled()
      There is at least one content encoder.
      Returns:
      whether there is at least one content encoder
    • contentDecodingEnabled

      boolean contentDecodingEnabled()
      There is at least one content decoder.
      Returns:
      whether there is at least one content decoder
    • contentEncodingSupported

      boolean contentEncodingSupported(String encodingId)
      Whether there is a content encoder for the provided id.
      Parameters:
      encodingId - encoding id
      Returns:
      whether a provider exists for this id
    • contentDecodingSupported

      boolean contentDecodingSupported(String encodingId)
      Whether there is a content decoder for the provided id.
      Parameters:
      encodingId - encoding id
      Returns:
      whether a provider exists for this id
    • encoder

      ContentEncoder encoder(String encodingId) throws NoSuchElementException
      Obtain a content encoder for the id.
      Parameters:
      encodingId - encoding id
      Returns:
      content encoder to use
      Throws:
      NoSuchElementException - in case an encoding provider does not exist
    • decoder

      ContentDecoder decoder(String encodingId) throws NoSuchElementException
      Obtain a content decoder for the id.
      Parameters:
      encodingId - encoding id
      Returns:
      content decoder to use
      Throws:
      NoSuchElementException - in case a decoding provider does not exist
    • encoder

      ContentEncoder encoder(Headers headers)
      Discover content encoder based on the HTTP headers.
      Parameters:
      headers - headers to analyze
      Returns:
      content encoder to use