package com.wizzardo.http.response;

/**
 * @author: wizzardo
 * Date: 3/31/14
 */
public enum Status {


    /**
     * Switching Protocols
     */
    _101(101, "Switching Protocols"),

    /**
     * OK
     */
    _200(200, "OK"),

    /**
     * Partial Content
     */
    _206(206, "Partial Content"),

    /**
     * Moved Permanently
     */
    _301(301, "Moved Permanently"),

    /**
     * Found
     */
    _302(302, "Found"),

    /**
     * Not Modified
     */
    _304(304, "Not Modified"),

    /**
     * Bad Request
     */
    _400(400, "Bad Request"),

    /**
     * Not Authorized
     */
    _401(401, "Not Authorized"),

    /**
     * Forbidden
     */
    _403(403, "Forbidden"),

    /**
     * Method Not Allowed
     */
    _405(405, "Method Not Allowed"),

    /**
     * Not Found
     */
    _404(404, "Not Found"),
    /**
     * Requested range not satisfiable
     */
    _416(416, "Requested range not satisfiable"),

    /**
     * Internal Server Error
     */
    _500(500, "Internal Server Error"),;

    public final byte[] bytes;
    public final int code;
    public final String message;

    private Status(int code, String message) {
        this.code = code;
        this.message = message;
        this.bytes = ("HTTP/1.1 " + code + " " + message + "\r\n").getBytes();
    }
}

@@ -1318,11 +1318,785 @@
 );%0A    %7D
+%0A%0A    public static Status valueOf(int status) %7B%0A        switch (status) %7B%0A            case 101:%0A                return _101;%0A            case 200:%0A                return _200;%0A            case 206:%0A                return _206;%0A            case 301:%0A                return _301;%0A            case 302:%0A                return _302;%0A            case 304:%0A                return _304;%0A            case 400:%0A                return _400;%0A            case 401:%0A                return _401;%0A            case 403:%0A                return _403;%0A            case 404:%0A                return _404;%0A            case 405:%0A                return _405;%0A            case 416:%0A                return _416;%0A            case 500:%0A                return _500;%0A        %7D%0A        return null;%0A    %7D
 %0A%7D%0A

add valueOf(int) method