/** * Builds a new full request based on the settings configured in this builder. * If {@code validate} is set to true: * <ul> * <li>the host header will be set if absent</li> * <li>an exception will be thrown if the content length is not an integer, or more than one content length exists</li> * <li>an exception will be thrown if the request method is not a valid HTTP method</li> * </ul> * * @return a new full request */ public FullHttpRequest build() { if (validate) { ensureContentLengthIsValid(); ensureMethodIsValid(); setHostHeader(); } return new FullHttpRequest(this); }