Exemple #1
0
 /**
  * Get the enum value given the numeric code.
  *
  * @param code HTTP response code
  * @return enum value
  */
 public static HTTPCode valueOf(final int code) {
   for (final HTTPCode h : HTTPCode.values()) {
     if (h.code == code) return h;
   }
   return null;
 }
Exemple #2
0
 /**
  * Constructor.
  *
  * @param code HTTP response status code
  * @param d data
  */
 public HTTPResponse(final int code, final String d) {
   status = HTTPCode.valueOf(code);
   data = d;
 }