Class ReactiveResponse.Content
java.lang.Object
org.eclipse.jetty.reactive.client.ReactiveResponse.Content
- Enclosing class:
ReactiveResponse
Collects utility methods to process response content.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<byte[]>> static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<byte[]>> asByteArray(int maxCapacity) static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<ReactiveResponse.Result<byte[]>>> static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<ReactiveResponse.Result<byte[]>>> asByteArrayResult(int maxCapacity) static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<ByteBuffer>> static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<ByteBuffer>> asByteBuffer(int maxCapacity) static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<ReactiveResponse.Result<ByteBuffer>>> static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<ReactiveResponse.Result<ByteBuffer>>> asByteBufferResult(int maxCapacity) static <T> BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<ReactiveResponse.Result<T>>> static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<String>> asString()static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<String>> asString(int maxCapacity) static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<ReactiveResponse.Result<String>>> static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<ReactiveResponse.Result<String>>> asStringResult(int maxCapacity) static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<ReactiveResponse>> discard()
-
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
ByteBufferup 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
ByteBufferup to the specified maximum capacity in bytes.
-
asByteArray
public static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<byte[]>> asByteArray()- Returns:
- a response content processing function that converts the content to a
byte[]up to 2097152 bytes.
-
asByteArray
public static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<byte[]>> asByteArray(int maxCapacity) - Returns:
- a response content processing function that converts the content to a
byte[]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.Resultwith anullcontent 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.Resultwith 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.Resultwith 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
ByteBufferup to 2097152 bytes, and produces aReactiveResponse.Resultwith theByteBuffercontent.
-
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
ByteBufferup to the specified maximum capacity in bytes, and produces aReactiveResponse.Resultwith theByteBuffercontent.
-
asByteArrayResult
public static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<ReactiveResponse.Result<byte[]>>> asByteArrayResult()- Returns:
- a response content processing function that converts the content to a
byte[]up to 2097152 bytes, and produces aReactiveResponse.Resultwith thebyte[]content.
-
asByteArrayResult
public static BiFunction<ReactiveResponse, org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>, org.reactivestreams.Publisher<ReactiveResponse.Result<byte[]>>> asByteArrayResult(int maxCapacity) - Returns:
- a response content processing function that converts the content to a
byte[]up to the specified maximum capacity in bytes, and produces aReactiveResponse.Resultwith thebyte[]content.
-