An object that builds new messages (rest/rpc, request/response).
{@link Message}s in the R2 system are immutable and are safe to use across threads. Builders provide a way to build new Messages, either from scratch or by copying an existing message or builder. Builders are not thread-safe, so they should be used only from one thread or proper synchronization should be used. Alternatively, a message, which is immutable, can be used as a template across threads - use {@link com.linkedin.r2.message.Message#builder()} to modify alocal copy.
Builders are designed to be chainable. For example, the following is a possible use of a RestBuilder:
final RestRequest request = new RestRequestBuilder(URI.create("test")) .setEntity(new byte[] {1,2,3,4}) .setHeader("k1", "v1") .setMethod(RestMethod.PUT) .build()
@see com.linkedin.r2.message.rest.RestRequestBuilder
@see com.linkedin.r2.message.rest.RestResponseBuilder
@see com.linkedin.r2.message.rpc.RpcRequestBuilder
@see com.linkedin.r2.message.rpc.RpcResponseBuilder
@author Chris Pettitt
@version $Revision$