gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-18 09:07:31 25 4
gpt4 key购买 nike

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

YarRequest.<init>介绍

暂无

代码示例

代码示例来源: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

protected byte[] buildRequestBtyes(long id, String path, String method, String packageName, Object... parameterObject)
    throws IOException {
  YarRequest yarRequest = new YarRequest(id, packageName, method, parameterObject);
  return YarProtocol.toProtocolBytes(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;
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com