class TransformPayloadInputBuilder {

    public static String build(JoltSpec joltSpec, String delegateExecutionRequestJsonPayload, MultiMap headers, final Matcher matcher){
        if(joltSpec.isWithMetadata()){
            JsonObject withMetadata = new JsonObject();
            withMetadata.put(URL_PARTS, buildUrlParts(matcher));
            withMetadata.put(HEADERS, buildHeaders(headers));
            withMetadata.put(PAYLOAD, new JsonObject(delegateExecutionRequestJsonPayload));
            return withMetadata.encode();
        } else {
            return delegateExecutionRequestJsonPayload;
        }
    }

}