Class ReactiveResponse.Content

java.lang.Object
org.eclipse.jetty.reactive.client.ReactiveResponse.Content
Enclosing class:
ReactiveResponse

public static class ReactiveResponse.Content extends Object
Collects utility methods to process response content.
  • Constructor Details

    • Content

      public Content()
  • Method Details

    • discard

      public static BiFunction<ReactiveResponse,org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>,org.reactivestreams.Publisher<ReactiveResponse>> discard()
      Returns:
      a response content processing function that discards the content
    • asString

      public static BiFunction<ReactiveResponse,org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>,org.reactivestreams.Publisher<String>> asString()
      Returns:
      a response content processing function that converts the content to a string up to 2097152 bytes.
    • asString

      public static BiFunction<ReactiveResponse,org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>,org.reactivestreams.Publisher<String>> asString(int maxCapacity)
      Returns:
      a response content processing function that converts the content to a string up to the specified maximum capacity in bytes.
    • asByteBuffer

      public static BiFunction<ReactiveResponse,org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>,org.reactivestreams.Publisher<ByteBuffer>> asByteBuffer()
      Returns:
      a response content processing function that converts the content to a ByteBuffer up to 2097152 bytes.
    • asByteBuffer

      public static BiFunction<ReactiveResponse,org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>,org.reactivestreams.Publisher<ByteBuffer>> asByteBuffer(int maxCapacity)
      Returns:
      a response content processing function that converts the content to a ByteBuffer up to the specified maximum capacity in bytes.
    • asDiscardResult

      public static <T> BiFunction<ReactiveResponse,org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>,org.reactivestreams.Publisher<ReactiveResponse.Result<T>>> asDiscardResult()
      Type Parameters:
      T - the type of the content
      Returns:
      a response content processing function that discards the content and produces a ReactiveResponse.Result with a null content of the given type.
    • asStringResult

      public static BiFunction<ReactiveResponse,org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>,org.reactivestreams.Publisher<ReactiveResponse.Result<String>>> asStringResult()
      Returns:
      a response content processing function that converts the content to a string up to 2097152 bytes, and produces a ReactiveResponse.Result with the string content.
    • asStringResult

      public static BiFunction<ReactiveResponse,org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>,org.reactivestreams.Publisher<ReactiveResponse.Result<String>>> asStringResult(int maxCapacity)
      Returns:
      a response content processing function that converts the content to a string up to the specified maximum capacity in bytes, and produces a ReactiveResponse.Result with the string content.
    • asByteBufferResult

      public static BiFunction<ReactiveResponse,org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>,org.reactivestreams.Publisher<ReactiveResponse.Result<ByteBuffer>>> asByteBufferResult()
      Returns:
      a response content processing function that converts the content to a ByteBuffer up to 2097152 bytes, and produces a ReactiveResponse.Result with the ByteBuffer content.
    • asByteBufferResult

      public static BiFunction<ReactiveResponse,org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>,org.reactivestreams.Publisher<ReactiveResponse.Result<ByteBuffer>>> asByteBufferResult(int maxCapacity)
      Returns:
      a response content processing function that converts the content to a ByteBuffer up to the specified maximum capacity in bytes, and produces a ReactiveResponse.Result with the ByteBuffer content.