Package io.vertx.reactivex.ext.web.codec
Class BodyCodec<T>
- java.lang.Object
-
- io.vertx.reactivex.ext.web.codec.BodyCodec<T>
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<BodyCodec>
__TYPE_ARG
io.vertx.lang.rx.TypeArg<T>
__typeArg_0
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BodyCodec<Buffer>
buffer()
static <T> BodyCodec<T>
create(java.util.function.Function<Buffer,T> decode)
Create a codec that buffers the entire body and then apply thedecode
function and returns the result.boolean
equals(Object o)
BodyCodec
getDelegate()
int
hashCode()
static <U> BodyCodec<U>
json(Class<U> type)
Create and return a codec for Java objects encoded using Jackson mapper.static BodyCodec<JsonArray>
jsonArray()
static BodyCodec<JsonObject>
jsonObject()
static BodyCodec<Void>
jsonStream(JsonParser parser)
A body codec that parse the response as a JSON stream.static <T> BodyCodec<T>
newInstance(BodyCodec arg)
static <T> BodyCodec<T>
newInstance(BodyCodec arg, io.vertx.lang.rx.TypeArg<T> __typeArg_T)
static BodyCodec<Void>
none()
static BodyCodec<Void>
pipe(WriteStream<Buffer> stream)
A body codec that pipes the body to a write stream.static BodyCodec<Void>
pipe(WriteStream<Buffer> stream, boolean close)
A body codec that pipes the body to a write stream.static BodyCodec<String>
string()
static BodyCodec<String>
string(String encoding)
A codec for strings using a specificencoding
.String
toString()
-
-
-
Method Detail
-
getDelegate
public BodyCodec getDelegate()
-
string
public static BodyCodec<String> string(String encoding)
A codec for strings using a specificencoding
.- Parameters:
encoding
- the encoding- Returns:
- the codec
-
jsonObject
public static BodyCodec<JsonObject> jsonObject()
- Returns:
- the codec
-
json
public static <U> BodyCodec<U> json(Class<U> type)
Create and return a codec for Java objects encoded using Jackson mapper.- Parameters:
type
-- Returns:
- a codec for mapping POJO to Json
-
create
public static <T> BodyCodec<T> create(java.util.function.Function<Buffer,T> decode)
Create a codec that buffers the entire body and then apply thedecode
function and returns the result.- Parameters:
decode
- the decode function- Returns:
- the created codec
-
pipe
public static BodyCodec<Void> pipe(WriteStream<Buffer> stream)
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
public static BodyCodec<Void> pipe(WriteStream<Buffer> stream, boolean close)
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
public static BodyCodec<Void> jsonStream(JsonParser parser)
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
-
-