Open
Description
Both the OperationRequestFactory
and OperationResponseFactory
leads to unnecessary code in custom pre-processors:
new OperationRequestFactory().create(
uri,
request.getMethod(),
request.getContent(),
headers,
request.getParts(),
cookies
);
A possible way to simplify the request creation is to use the Builder design pattern:
new OperationRequestBuider(request)
.withUri(uri)
.withHeaders(headers)
.withCookies(cookies)
.build();
The OperationRequestBuilder
will builds the new request using the request argument fields as defaults, like a StringBuilder
.