Interface BodyTransformer

  • All Superinterfaces:
    java.util.function.Function<Buffer,​Buffer>

    @Unstable
    public interface BodyTransformer
    extends java.util.function.Function<Buffer,​Buffer>
    The callback to transform the request or response body.
    • Method Detail

      • transformJsonObject

        static BodyTransformer transformJsonObject​(java.util.function.Function<JsonObject,​JsonObject> transformer)
        Create a callback for transform JsonObject.
        Parameters:
        transformer - the operation to transform data
        Returns:
        the built callback
      • transformJsonArray

        static BodyTransformer transformJsonArray​(java.util.function.Function<JsonArray,​JsonArray> transformer)
        Create a callback for transform JsonArray.
        Parameters:
        transformer - the operation to transform data
        Returns:
        the built callback
      • transformJson

        static BodyTransformer transformJson​(java.util.function.Function<Object,​Object> transformer)
        Create a callback for transform json with unknown shape.
        Parameters:
        transformer - the operation to transform data
        Returns:
        the built callback
      • transformText

        static BodyTransformer transformText​(java.util.function.Function<String,​String> transformer,
                                             String encoding)
        Create a callback for transform texts.
        Parameters:
        transformer - the operation to transform data
        Returns:
        the built callback
      • discard

        static BodyTransformer discard()
        Create a callback to discard the body.
        Returns:
        the built callback