/** * Sets the status code of the Message to build. * * @param statusCode the status code. * @return this builder to allow method chaining. * @throws IllegalArgumentException if {@code statusCode} is unknown. */ public MessageHeadersBuilder statusCode(final int statusCode) { return statusCode(HttpStatusCode.forInt(statusCode).orElseThrow(() -> { final String msg = MessageFormat.format("HTTP status code <{0}> is unknown!", statusCode); return new IllegalArgumentException(msg); })); }