@Test(expected = IllegalArgumentException.class) public void test2DigitStatusCodeIsNotAllowed() { HttpResponseStatus.of(99, "My Own Status Code"); }
public static HttpResponseStatus of(final int statusCode, final String reasonPhrase) { final HttpResponseStatus cached = valueOf(statusCode); if (cached != null && (reasonPhrase.isEmpty() || cached.reasonPhrase.equals(reasonPhrase))) { return cached; } return new HttpResponseStatus(statusCode, reasonPhrase); }
HttpResponseStatus { public static HttpResponseStatus of(final int statusCode, final String reasonPhrase) { final HttpResponseStatus cached = valueOf(statusCode); if (cached != null && (reasonPhrase.isEmpty() || cached.reasonPhrase.equals(reasonPhrase))) { return cached; } return new HttpResponseStatus(statusCode, reasonPhrase); } }
HttpResponseStatus { public static HttpResponseStatus of(final int statusCode, final String reasonPhrase) { final HttpResponseStatus cached = valueOf(statusCode); if (cached != null && (reasonPhrase.isEmpty() || cached.reasonPhrase.equals(reasonPhrase))) { return cached; } return new HttpResponseStatus(statusCode, reasonPhrase); } private  HttpResponseStatus(final int statusCode, final String reasonPhrase); }
HttpResponseStatus { public static HttpResponseStatus of(final int statusCode, final String reasonPhrase) { final HttpResponseStatus cached = valueOf(statusCode); if (cached != null && (reasonPhrase.isEmpty() || cached.reasonPhrase.equals(reasonPhrase))) { return cached; } return new HttpResponseStatus(statusCode, reasonPhrase); } private  HttpResponseStatus(final int statusCode, final String reasonPhrase); static HttpResponseStatus of(final int statusCode, final String reasonPhrase); static HttpResponseStatus of(final CharSequence statusCode); int code(); CharSequence codeAsCharSequence(); String reasonPhrase(); void writeTo(final Buffer buffer); StatusClass statusClass(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); }
HttpResponseStatus { public static HttpResponseStatus of(final int statusCode, final String reasonPhrase) { final HttpResponseStatus cached = valueOf(statusCode); if (cached != null && (reasonPhrase.isEmpty() || cached.reasonPhrase.equals(reasonPhrase))) { return cached; } return new HttpResponseStatus(statusCode, reasonPhrase); } private  HttpResponseStatus(final int statusCode, final String reasonPhrase); static HttpResponseStatus of(final int statusCode, final String reasonPhrase); static HttpResponseStatus of(final CharSequence statusCode); int code(); CharSequence codeAsCharSequence(); String reasonPhrase(); void writeTo(final Buffer buffer); StatusClass statusClass(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); static final HttpResponseStatus CONTINUE; static final HttpResponseStatus SWITCHING_PROTOCOLS; static final HttpResponseStatus PROCESSING; static final HttpResponseStatus EARLY_HINTS; static final HttpResponseStatus OK; static final HttpResponseStatus CREATED; static final HttpResponseStatus ACCEPTED; static final HttpResponseStatus NON_AUTHORITATIVE_INFORMATION; static final HttpResponseStatus NO_CONTENT; static final HttpResponseStatus RESET_CONTENT; static final HttpResponseStatus PARTIAL_CONTENT; static final HttpResponseStatus MULTI_STATUS; static final HttpResponseStatus ALREADY_REPORTED; static final HttpResponseStatus IM_USED; static final HttpResponseStatus MULTIPLE_CHOICES; static final HttpResponseStatus MOVED_PERMANENTLY; static final HttpResponseStatus FOUND; static final HttpResponseStatus SEE_OTHER; static final HttpResponseStatus NOT_MODIFIED; static final HttpResponseStatus USE_PROXY; static final HttpResponseStatus TEMPORARY_REDIRECT; static final HttpResponseStatus PERMANENT_REDIRECT; static final HttpResponseStatus BAD_REQUEST; static final HttpResponseStatus UNAUTHORIZED; static final HttpResponseStatus PAYMENT_REQUIRED; static final HttpResponseStatus FORBIDDEN; static final HttpResponseStatus NOT_FOUND; static final HttpResponseStatus METHOD_NOT_ALLOWED; static final HttpResponseStatus NOT_ACCEPTABLE; static final HttpResponseStatus PROXY_AUTHENTICATION_REQUIRED; static final HttpResponseStatus REQUEST_TIMEOUT; static final HttpResponseStatus CONFLICT; static final HttpResponseStatus GONE; static final HttpResponseStatus LENGTH_REQUIRED; static final HttpResponseStatus PRECONDITION_FAILED; static final HttpResponseStatus PAYLOAD_TOO_LARGE; static final HttpResponseStatus URI_TOO_LONG; static final HttpResponseStatus UNSUPPORTED_MEDIA_TYPE; static final HttpResponseStatus RANGE_NOT_SATISFIABLE; static final HttpResponseStatus EXPECTATION_FAILED; static final HttpResponseStatus MISDIRECTED_REQUEST; static final HttpResponseStatus UNPROCESSABLE_ENTITY; static final HttpResponseStatus LOCKED; static final HttpResponseStatus FAILED_DEPENDENCY; static final HttpResponseStatus TOO_EARLY; static final HttpResponseStatus UPGRADE_REQUIRED; static final HttpResponseStatus PRECONDITION_REQUIRED; static final HttpResponseStatus TOO_MANY_REQUESTS; static final HttpResponseStatus REQUEST_HEADER_FIELDS_TOO_LARGE; static final HttpResponseStatus UNAVAILABLE_FOR_LEGAL_REASONS; static final HttpResponseStatus INTERNAL_SERVER_ERROR; static final HttpResponseStatus NOT_IMPLEMENTED; static final HttpResponseStatus BAD_GATEWAY; static final HttpResponseStatus SERVICE_UNAVAILABLE; static final HttpResponseStatus GATEWAY_TIMEOUT; static final HttpResponseStatus HTTP_VERSION_NOT_SUPPORTED; static final HttpResponseStatus VARIANT_ALSO_NEGOTIATES; static final HttpResponseStatus INSUFFICIENT_STORAGE; static final HttpResponseStatus LOOP_DETECTED; static final HttpResponseStatus NOT_EXTENDED; static final HttpResponseStatus NETWORK_AUTHENTICATION_REQUIRED; }