Package io.vertx.mutiny.ext.web.codec
Class BodyCodec<T>
java.lang.Object
io.vertx.mutiny.ext.web.codec.BodyCodec<T>
- All Implemented Interfaces:
MutinyDelegate
A codec for encoding and decoding HTTP bodies.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Julien Viet
- See Also:
-
BodyCodec
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BodyCodec<io.vertx.core.buffer.Buffer>buffer()booleanio.vertx.ext.web.codec.BodyCodec<T>Get the delegate instance.inthashCode()static <U> BodyCodec<U>Create and return a codec for Java objects encoded using Jackson mapper.static BodyCodec<io.vertx.core.json.JsonArray>static BodyCodec<io.vertx.core.json.JsonObject>jsonStream(JsonParser parser) A body codec that parse the response as a JSON stream.static <T> BodyCodec<T>newInstance(io.vertx.ext.web.codec.BodyCodec<T> delegate) Creates a new instance of theBodyCodec.static <T> BodyCodec<T>newInstance(io.vertx.ext.web.codec.BodyCodec<T> delegate, TypeArg<T> typeArg_0) Creates a new instance of theBodyCodec.none()pipe(WriteStream<io.vertx.core.buffer.Buffer> stream) A body codec that pipes the body to a write stream.pipe(WriteStream<io.vertx.core.buffer.Buffer> stream, boolean close) A body codec that pipes the body to a write stream.sseStream(Consumer<ReadStream<io.vertx.ext.web.codec.SseEvent>> handler) A body codec that parse the response as a Server-SentEvent stream.static <T> BodyCodec<T>Create a codec that buffers the entire body and then apply thedecodefunction and returns the result.string()A codec for strings using a specificencoding.toString()
-
Field Details
-
__TYPE_ARG
-
__typeArg_0
-
-
Constructor Details
-
BodyCodec
Create a new instance ofBodyCodecdelegating to the given (non-null) instance ofBodyCodec. -
BodyCodec
-
BodyCodec
-
-
Method Details
-
getDelegate
Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
string
- Returns:
- the UTF-8 string codec
-
string
A codec for strings using a specificencoding.- Parameters:
encoding- the encoding- Returns:
- the codec
-
buffer
- Returns:
- the
Buffercodec
-
jsonObject
- Returns:
- the
JsonObjectcodec
-
jsonArray
- Returns:
- the
JsonArraycodec
-
json
Create and return a codec for Java objects encoded using Jackson mapper.- Returns:
- a codec for mapping POJO to Json
-
none
- Returns:
- a codec that simply discards the response
-
stream
Create a codec that buffers the entire body and then apply thedecodefunction and returns the result.- Parameters:
decode- the decode function- Returns:
- the created codec
-
pipe
A body codec that pipes the body to a write stream. Same as pipe(stream, true).- Parameters:
stream- the destination stream- Returns:
- the body codec for a write stream
-
pipe
A body codec that pipes the body to a write stream.- Parameters:
stream- the destination streamclose- whether the destination stream should be closed- Returns:
- the body codec for a write stream
-
jsonStream
A body codec that parse the response as a JSON stream.- Parameters:
parser- the non-null JSON parser to emits the JSON object. The parser must be configured for the stream. Not e that you need to keep a reference on the parser to retrieved the JSON events.- Returns:
- the body codec for a write stream
-
sseStream
public static BodyCodec<Void> sseStream(Consumer<ReadStream<io.vertx.ext.web.codec.SseEvent>> handler) A body codec that parse the response as a Server-SentEvent stream.- Parameters:
handler- the non-nullhandlerfor the stream of Server-Sent Events.- Returns:
- the body codec for a write stream
-
newInstance
Creates a new instance of theBodyCodec. -
newInstance
public static <T> BodyCodec<T> newInstance(io.vertx.ext.web.codec.BodyCodec<T> delegate, TypeArg<T> typeArg_0) Creates a new instance of theBodyCodec. -
hashCode
public int hashCode() -
equals
-
toString
-