/** * Set HTTP response type and body simultaneously. * They are inherently coupled together: a body without a content type * is meaningless; a content type without a body is useless. */ public void setResponse(ContentType contentType, String body) { if (contentType == null) { throw new NullPointerException("Null content type"); } if (body == null) { throw new NullPointerException("Null response body"); } responseContentType = contentType; setResponseBody(body); }
/** * Set HTTP response type and body simultaneously. * They are inherently coupled together: a body without a content type * is meaningless; a content type without a body is useless. */ public void setResponse(ContentType contentType, String body) { if (contentType == null) { throw new NullPointerException("Null content type"); } if (body == null) { throw new NullPointerException("Null response body"); } responseContentType = contentType; setResponseBody(body); }
/** * Set HTTP response type and body simultaneously. * They are inherently coupled together: a body without a content type * is meaningless; a content type without a body is useless. */ public void setResponse(ContentType contentType, String body) { if (contentType == null) { throw new NullPointerException("Null content type"); } if (body == null) { throw new NullPointerException("Null response body"); } responseContentType = contentType; setResponseBody(body); }