com.weibo.yar.YarRequest.getParameters()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中com.weibo.yar.YarRequest.getParameters()方法的一些代码示例,展示了YarRequest.getParameters()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarRequest.getParameters()方法的具体详情如下:
包路径:com.weibo.yar.YarRequest
类名称:YarRequest
方法名:getParameters

YarRequest.getParameters介绍

暂无

代码示例

代码示例来源:origin: weibocom/motan

public AttachmentRequest(YarRequest yarRequest, Map<String, String> attachments) {
  this(yarRequest.getId(), yarRequest.getPackagerName(), yarRequest.getMethodName(), yarRequest.getParameters());
  this.attachments = attachments;
}

代码示例来源:origin: weibocom/motan

/**
 * convert yar request to motan rpc request
 * 
 * @param yarRequest
 * @param interfaceClass
 * @return
 */
public static Request convert(YarRequest yarRequest, Class<?> interfaceClass) {
  DefaultRequest request = new DefaultRequest();
  request.setInterfaceName(interfaceClass.getName());
  request.setMethodName(yarRequest.getMethodName());
  request.setRequestId(yarRequest.getId());
  addArguments(request, interfaceClass, yarRequest.getMethodName(), yarRequest.getParameters());
  if (yarRequest instanceof AttachmentRequest) {
    request.setAttachments(((AttachmentRequest) yarRequest).getAttachments());
  }
  return request;
}

代码示例来源:origin: com.weibo/yar-java

public static byte[] toProtocolBytes(YarRequest request) throws IOException {
  if (request == null) {
    throw new YarException("YarRequest is null");
  }
  Map<String, Object> requestMap = new HashMap<String, Object>();
  requestMap.put("i", request.getId());
  requestMap.put("m", request.getMethodName());
  requestMap.put("p", Arrays.asList(request.getParameters()));
  String packagerName = request.getPackagerName();
  return toProtocolBytes(request.getId(), packagerName, requestMap);
}

相关文章