private static HttpStatus newConstant(int statusCode, String reasonPhrase) { final HttpStatus status = new HttpStatus(statusCode, reasonPhrase); map[statusCode] = status; return status; }
/** * Returns the {@link HttpStatus} represented by the specified status code. */ public static HttpStatus valueOf(int statusCode) { if (statusCode < 0 || statusCode >= 1000) { return new HttpStatus(statusCode); } else { return map[statusCode]; } }