本文整理了Java中com.weibo.yar.YarRequest.setParameters()
方法的一些代码示例,展示了YarRequest.setParameters()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarRequest.setParameters()
方法的具体详情如下:
包路径:com.weibo.yar.YarRequest
类名称:YarRequest
方法名:setParameters
暂无
代码示例来源:origin: weibocom/motan
public static YarRequest convert(Request request, String packagerName) {
YarRequest yarRequest = new YarRequest();
yarRequest.setId(request.getRequestId());
yarRequest.setMethodName(request.getMethodName());
yarRequest.setPackagerName(packagerName);
yarRequest.setParameters(request.getArguments());
return yarRequest;
}
代码示例来源:origin: com.weibo/yar-java
@SuppressWarnings("rawtypes")
public static YarRequest buildRequest(byte[] requestBytes) throws IOException {
if (requestBytes == null) {
throw new YarException("request bytes is null");
}
Map contentMap = fetchContent(requestBytes);
YarRequest request = new YarRequest();
if (contentMap.containsKey("i")) {
request.setId(((Number) contentMap.get("i")).longValue());
}
request.setPackagerName((String) contentMap.get("ext-packagerName"));
if (contentMap.containsKey("m")) {
request.setMethodName((contentMap.get("m").toString()));
}
if (contentMap.containsKey("p")) {
Object value = contentMap.get("p");
if ((value instanceof List)) {
request.setParameters(((List) value).toArray());
} else if (value instanceof Map) {
request.setParameters(((Map) value).values().toArray());
}
}
return request;
}
内容来源于网络,如有侵权,请联系作者删除!