Get the status message for a specific code.

@param code
the code to look up
@return the specific message, or the code number itself if code
does not match known list.
12820
public static String getMessage(int code)
    {
        Code codeEnum = getCode(code);
        if (codeEnum != null)
        {
            return codeEnum.getMessage();
        }
        else
        {
            return Integer.toString(code);
        }
    }
1312653
public static HttpResponseStatus valueOf(int code) {
        switch (code) {
        case 250: return LOW_STORAGE_SPACE;
        case 302: return MOVED_TEMPORARILY;
        case 451: return PARAMETER_NOT_UNDERSTOOD;
        case 452: return CONFERENCE_NOT_FOUND;
        case 453: return NOT_ENOUGH_BANDWIDTH;
        case 454: return SESSION_NOT_FOUND;
        case 455: return METHOD_NOT_VALID;
        case 456: return HEADER_FIELD_NOT_VALID;
        case 457: return INVALID_RANGE;
        case 458: return PARAMETER_IS_READONLY;
        case 459: return AGGREGATE_OPERATION_NOT_ALLOWED;
        case 460: return ONLY_AGGREGATE_OPERATION_ALLOWED;
        case 461: return UNSUPPORTED_TRANSPORT;
        case 462: return DESTINATION_UNREACHABLE;
        case 463: return KEY_MANAGEMENT_FAILURE;
        case 505: return RTSP_VERSION_NOT_SUPPORTED;
        case 551: return OPTION_NOT_SUPPORTED;
        default:  return HttpResponseStatus.valueOf(code);
        }
    }
991384
public static HttpStatus fromStatusCode(final int statusCode)
	{
		if (statusCode < 100 || statusCode > 999)
		{
			throw new IllegalArgumentException("Illegal status code " + statusCode);
		}

		HttpStatus result = STATUS_CODES.get(statusCode);
		if (result == null)
		{
			return new HttpStatus(statusCode, "Unknown");
		}
		return result;
	}
831700
public static StatusCodes getByOrdinal(int i) {
        if (0 > i || i >= MAX_CODE) {
            throw new IndexOutOfBoundsException("Index " + i + " is out of bounds");
        }
        return statusCodes[i];
    }
465399
public void setStatus(int code,String message)
    {
        setStatus(code);
        Integer code_integer=TypeUtil.newInteger(code);
        if (message == null)
        {
            message = (String)__statusMsg.get(code_integer);
            if (message==null)
                message=""+code;
            setReason(message);
        }
        else
            setReason(UrlEncoded.encodeString(message));
    }
1212205
public List
getOptions(int code) {
	if (options == null)
		return Collections.EMPTY_LIST;
	List list = null;
	for (Iterator it = options.iterator(); it.hasNext(); ) {
		Option opt = (Option) it.next();
		if (opt.code == code) {
			if (list == null)
				list = new ArrayList();
			list.add(opt.data);
		}
	}
	if (list == null)
		return Collections.EMPTY_LIST;
	return list;
}
306192
public HttpStatus getStatusCode() {
        final Object statusCode = getHeader(HttpMessageHeaders.HTTP_STATUS_CODE);

        if (statusCode != null) {
            if (statusCode instanceof HttpStatus) {
                return (HttpStatus) statusCode;
            } else if (statusCode instanceof Integer) {
                return HttpStatus.valueOf((Integer) statusCode);
            } else {
                return HttpStatus.valueOf(Integer.valueOf(statusCode.toString()));
            }
        }

        return null;
    }
531579
@Override
    protected MessageFormat resolveCode(String code, Locale locale) {
        MessageFormat messageFormat = null;
        for (int i = 0; messageFormat == null && i < this.basenames.length; i++) {
            ResourceBundle bundle = getResourceBundle(this.basenames[i], locale);
            if (bundle != null) {
                messageFormat = getMessageFormat(bundle, code, locale);
            }
        }
        return messageFormat;
    }
999150
public static function getDefaultStatusMessage($statusCode)
	{
		$statusCode = (int) $statusCode;
		
		if (isset(self::$_defaultStatusMessages[$statusCode]))
		{
			return self::$_defaultStatusMessages[$statusCode];
		}
		
		return "Unknown Status";
	}
1287169
@Override
    public void setStatusCode(int code) {
        StatusCodes val = null;
        try {
            val = StatusCodes.getByOrdinal(code);
        } catch (IndexOutOfBoundsException e) {
            // no FFDC required
            // nothing to do, just make the undefined value below
        }

        // this could be null because the ordinal lookup returned an empty
        // status code, or because it was out of bounds
        if (null == val) {
            val = StatusCodes.makeUndefinedValue(code);
        }
        setStatusCode(val);
    }
76776
def get_code(self):
        
        code = UNKNOWN
        for result in self._results:
            if code == UNKNOWN or (result.code < UNKNOWN
                                   and result.code > code):
                code = result.code
        return code
412583
@Basic
    @Column(name = "CODE", unique = true, nullable = false, length=255)
	public String getCode() 
	{
		return code;
	}
581133
def get_code(self):
          # noqa

        buff = self.get_attribute("Code")
        if buff is None:
            return None

        with unpack(buff) as up:
            code = JavaCodeInfo(self.cpool)
            code.unpack(up)

        return code
193458
public OauthGetTokenResponse getToken(String code) {
        BeanUtil.requireNonNull(code, "code is null");
        OauthGetTokenResponse response = null;
        String url = BASE_API_URL + "sns/oauth2/access_token?appid=" + this.config.getAppid() + "&secret=" + this.config.getSecret() + "&code=" + code + "&grant_type=authorization_code";
        BaseResponse r = executeGet(url);
        String resultJson = isSuccess(r.getErrcode()) ? r.getErrmsg() : r.toJsonString();
        response = JSONUtil.toBean(resultJson, OauthGetTokenResponse.class);
        return response;
    }
71607
public MatcherPattern findMatcherPattern(int patternCode) {
        MatcherPattern result = null;
        for (MatcherPattern entry : this.matcherPatterns) {
            if (entry.getPatternCode() == patternCode) {
                result = entry;
                break;
            }
        }
        return result;
    }
18954
public static function getStatusMessage($code) {
    if (array_key_exists($code, self::$status_messages)) {
      return self::$status_messages[$code];
    }
    return sprintf("Unknown Code %d", $code);
  }
459479
@Override
	public String getMessage(String code, Object... args) {
		return messageSource.getMessage(code, args);
	}