Package io.vertx.rxjava3.httpproxy
Class BodyTransformers
- java.lang.Object
-
- io.vertx.rxjava3.httpproxy.BodyTransformers
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<BodyTransformers>
__TYPE_ARG
static long
DEFAULT_MAX_BUFFERED_SIZE
The default maximum amount of bytes synchronous transformers apply
-
Constructor Summary
Constructors Constructor Description BodyTransformers(BodyTransformers delegate)
BodyTransformers(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BodyTransformer
discard()
Create a transformer that discards the body, the transformer consumes any media type.boolean
equals(Object o)
BodyTransformers
getDelegate()
int
hashCode()
static BodyTransformer
jsonArray(long maxBufferedBytes, Function<JsonArray,JsonArray> transformer)
Create a body transformer that transforms JSON array to JSON array, the transformer consumes and producesapplication/json
.static BodyTransformer
jsonArray(Function<JsonArray,JsonArray> transformer)
LikejsonArray(long, java.util.function.Function<io.vertx.core.json.JsonArray, io.vertx.core.json.JsonArray>)
withBodyTransformers
maximum buffered bytes.static BodyTransformer
jsonObject(long maxBufferedBytes, Function<JsonObject,JsonObject> transformer)
Create a body transformer that transforms JSON object to JSON object, the transformer consumes and producesapplication/json
.static BodyTransformer
jsonObject(Function<JsonObject,JsonObject> transformer)
LikejsonObject(long, java.util.function.Function<io.vertx.core.json.JsonObject, io.vertx.core.json.JsonObject>)
withBodyTransformers
maximum buffered bytes.static BodyTransformer
jsonValue(long maxBufferedBytes, Function<Object,Object> transformer)
Create a body transformer that transforms JSON value to JSON value, the transformer consumes and producesapplication/json
.static BodyTransformer
jsonValue(Function<Object,Object> transformer)
LikejsonValue(long, java.util.function.Function<java.lang.Object, java.lang.Object>)
withBodyTransformers
maximum buffered bytes.static BodyTransformers
newInstance(BodyTransformers arg)
static BodyTransformer
text(long maxBufferedBytes, Function<String,String> transformer, String encoding)
Create a transformer that transforms text to text, the transformer consumes and producestext/plain
.static BodyTransformer
text(Function<String,String> transformer, String encoding)
Liketext(long, java.util.function.Function<java.lang.String, java.lang.String>, java.lang.String)
withBodyTransformers
maximum buffered bytes.String
toString()
static BodyTransformer
transform(MediaType consumes, MediaType produces, long maxBufferedBytes, Function<Buffer,Buffer> transformer)
Create a body transformer that transformsconsumes
media type to theproduces
media type, by applying thetransformer
function.static BodyTransformer
transform(MediaType consumes, MediaType produces, Function<Buffer,Buffer> transformer)
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<BodyTransformers> __TYPE_ARG
-
DEFAULT_MAX_BUFFERED_SIZE
public static final long DEFAULT_MAX_BUFFERED_SIZE
The default maximum amount of bytes synchronous transformers apply- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BodyTransformers
public BodyTransformers(BodyTransformers delegate)
-
BodyTransformers
public BodyTransformers(Object delegate)
-
-
Method Detail
-
getDelegate
public BodyTransformers getDelegate()
- Specified by:
getDelegate
in interfaceio.vertx.lang.rx.RxDelegate
-
jsonObject
public static BodyTransformer jsonObject(long maxBufferedBytes, Function<JsonObject,JsonObject> transformer)
Create a body transformer that transforms JSON object to JSON object, the transformer consumes and producesapplication/json
.- Parameters:
maxBufferedBytes
- the maximum amount of bytes buffered by the body transformertransformer
- the transformer function- Returns:
- the transformer instance
-
jsonObject
public static BodyTransformer jsonObject(Function<JsonObject,JsonObject> transformer)
LikejsonObject(long, java.util.function.Function<io.vertx.core.json.JsonObject, io.vertx.core.json.JsonObject>)
withBodyTransformers
maximum buffered bytes.- Parameters:
transformer
-- Returns:
-
jsonArray
public static BodyTransformer jsonArray(long maxBufferedBytes, Function<JsonArray,JsonArray> transformer)
Create a body transformer that transforms JSON array to JSON array, the transformer consumes and producesapplication/json
.- Parameters:
maxBufferedBytes
- the maximum amount of bytes buffered by the body transformertransformer
- the transformer function- Returns:
- the transformer instance
-
jsonArray
public static BodyTransformer jsonArray(Function<JsonArray,JsonArray> transformer)
LikejsonArray(long, java.util.function.Function<io.vertx.core.json.JsonArray, io.vertx.core.json.JsonArray>)
withBodyTransformers
maximum buffered bytes.- Parameters:
transformer
-- Returns:
-
jsonValue
public static BodyTransformer jsonValue(long maxBufferedBytes, Function<Object,Object> transformer)
Create a body transformer that transforms JSON value to JSON value, the transformer consumes and producesapplication/json
.- Parameters:
maxBufferedBytes
- the maximum amount of bytes buffered by the body transformertransformer
- the transformer function- Returns:
- the transformer instance
-
jsonValue
public static BodyTransformer jsonValue(Function<Object,Object> transformer)
LikejsonValue(long, java.util.function.Function<java.lang.Object, java.lang.Object>)
withBodyTransformers
maximum buffered bytes.- Parameters:
transformer
-- Returns:
-
text
public static BodyTransformer text(long maxBufferedBytes, Function<String,String> transformer, String encoding)
Create a transformer that transforms text to text, the transformer consumes and producestext/plain
.- Parameters:
maxBufferedBytes
- the maximum amount of bytes buffered by the body transformertransformer
- the transformer functionencoding
-- Returns:
- the transformer instance
-
text
public static BodyTransformer text(Function<String,String> transformer, String encoding)
Liketext(long, java.util.function.Function<java.lang.String, java.lang.String>, java.lang.String)
withBodyTransformers
maximum buffered bytes.- Parameters:
transformer
-encoding
-- Returns:
-
discard
public static BodyTransformer discard()
Create a transformer that discards the body, the transformer consumes any media type.- Returns:
- the transformer instance
-
transform
public static BodyTransformer transform(MediaType consumes, MediaType produces, Function<Buffer,Buffer> transformer)
Liketransform(io.vertx.httpproxy.MediaType, io.vertx.httpproxy.MediaType, java.util.function.Function<io.vertx.core.buffer.Buffer, io.vertx.core.buffer.Buffer>)
withBodyTransformers
maximum buffered bytes.- Parameters:
consumes
-produces
-transformer
-- Returns:
-
transform
public static BodyTransformer transform(MediaType consumes, MediaType produces, long maxBufferedBytes, Function<Buffer,Buffer> transformer)
Create a body transformer that transforms
consumes
media type to theproduces
media type, by applying thetransformer
function.The transformer buffers up to
maxBufferedBytes
and then apply thetransformer
function. When the body exceeds the limit, the transformes signal an error and fail the transformation.- Parameters:
consumes
- the consumed media typeproduces
- the produced media typemaxBufferedBytes
- the maximum amount of bytes buffered by the body transformertransformer
- the transformer- Returns:
- the body transformer
-
newInstance
public static BodyTransformers newInstance(BodyTransformers arg)
-
-