本文整理了Java中com.alibaba.fastjson.JSONObject.getLong()
方法的一些代码示例,展示了JSONObject.getLong()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONObject.getLong()
方法的具体详情如下:
包路径:com.alibaba.fastjson.JSONObject
类名称:JSONObject
方法名:getLong
暂无
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public Long getLong(String key) {
return jsonObject.getLong(key);
}
代码示例来源:origin: alibaba/nacos
long timestamp = entry.getLong("timestamp");
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public Long getLong(String key) {
return jsonObject.getLong(key);
}
代码示例来源:origin: uber/chaperone
String metricsInStr = rs.getString("metrics");
JSONObject oldMetricsInJSON = JSON.parseObject(metricsInStr);
long count = oldMetricsInJSON.getLong("count");
double meanLatency = oldMetricsInJSON.getDouble("mean");
double p95Latency = oldMetricsInJSON.getDouble("mean95");
代码示例来源:origin: alibaba/nacos
public long sendBeat(BeatInfo beatInfo) {
try {
LogUtils.LOG.info("BEAT", "{} sending beat to server: {}", namespaceId, beatInfo.toString());
Map<String, String> params = new HashMap<String, String>(4);
params.put("beat", JSON.toJSONString(beatInfo));
params.put(Constants.REQUEST_PARAM_NAMESPACE_ID, namespaceId);
params.put("serviceName", beatInfo.getServiceName());
String result = reqAPI(UtilAndComs.NACOS_URL_BASE + "/instance/beat", params, HttpMethod.PUT);
JSONObject jsonObject = JSON.parseObject(result);
if (jsonObject != null) {
return jsonObject.getLong("clientBeatInterval");
}
} catch (Exception e) {
LogUtils.LOG.error("CLIENT-BEAT", "failed to send beat: " + JSON.toJSONString(beatInfo), e);
}
return 0L;
}
代码示例来源:origin: hs-web/hsweb-framework
conf.put("maxSize", this.jsonConfig.getLong("fileMaxSize"));
conf.put("allowFiles", this.getArray("fileAllowFiles"));
conf.put("fieldName", this.jsonConfig.getString("fileFieldName"));
conf.put("maxSize", this.jsonConfig.getLong("imageMaxSize"));
conf.put("allowFiles", this.getArray("imageAllowFiles"));
conf.put("fieldName", this.jsonConfig.getString("imageFieldName"));
conf.put("maxSize", this.jsonConfig.getLong("videoMaxSize"));
conf.put("allowFiles", this.getArray("videoAllowFiles"));
conf.put("fieldName", this.jsonConfig.getString("videoFieldName"));
conf.put("maxSize", this.jsonConfig.getLong("scrawlMaxSize"));
conf.put("fieldName", this.jsonConfig.getString("scrawlFieldName"));
conf.put("isBase64", "true");
conf.put("filename", ConfigManager.REMOTE_FILE_NAME);
conf.put("filter", this.getArray("catcherLocalDomain"));
conf.put("maxSize", this.jsonConfig.getLong("catcherMaxSize"));
conf.put("allowFiles", this.getArray("catcherAllowFiles"));
conf.put("fieldName", this.jsonConfig.getString("catcherFieldName") + "[]");
代码示例来源:origin: jmdhappy/xxpay-master
Long payAmount = payOrder.getLong("amount");
代码示例来源:origin: yaphone/itchat4j
List<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();
if (fullFriendsJsonList.get("Seq") != null) {
seq = fullFriendsJsonList.getLong("Seq");
currentTime = new Date().getTime();
seq = fullFriendsJsonList.getLong("Seq");
currentTime = new Date().getTime();
代码示例来源:origin: apache/rocketmq-externals
private void initPositionFromMqTail() throws Exception {
DefaultMQPullConsumer consumer = new DefaultMQPullConsumer("BINLOG_CONSUMER_GROUP");
consumer.setNamesrvAddr(config.mqNamesrvAddr);
consumer.setMessageModel(MessageModel.valueOf("BROADCASTING"));
consumer.start();
Set<MessageQueue> queues = consumer.fetchSubscribeMessageQueues(config.mqTopic);
MessageQueue queue = queues.iterator().next();
if (queue != null) {
Long offset = consumer.maxOffset(queue);
if (offset > 0)
offset--;
PullResult pullResult = consumer.pull(queue, "*", offset, 100);
if (pullResult.getPullStatus() == PullStatus.FOUND) {
MessageExt msg = pullResult.getMsgFoundList().get(0);
String json = new String(msg.getBody(), "UTF-8");
JSONObject js = JSON.parseObject(json);
binlogFilename = (String) js.get("binlogFilename");
nextPosition = js.getLong("nextPosition");
}
}
}
代码示例来源:origin: wangdan/AisenWeiBo
comment.setCreated_at(card.getString("created_at"));
comment.setSource(card.getString("source"));
comment.setLikedCount(card.getLong("like_counts"));
comment.setLiked(card.getBoolean("liked"));
代码示例来源:origin: gaopu/Java
if (errno == 0) {
JSONObject tempJsonObject = jsonObject.getJSONObject("data");
rid = String.valueOf(tempJsonObject.getLong("rid"));
appid = tempJsonObject.getString("appid");
ts = String.valueOf(tempJsonObject.getLong("ts"));
sign = tempJsonObject.getString("sign");
authType = tempJsonObject.getString("authType");
代码示例来源:origin: foxinmy/weixin4j
@Override
public Token create() throws WeixinException {
WeixinResponse response = null;
if (ticketType == TicketType.jsapi) {
response = weixinExecutor.get(String.format(
URLConsts.JS_TICKET_URL, weixinTokenManager.getCache()
.getAccessToken()));
} else {
response = weixinExecutor.get(String.format(
URLConsts.SUITE_TICKET_URL, weixinTokenManager.getCache()
.getAccessToken(), ticketType.name()));
}
JSONObject result = response.getAsJson();
return new Token(result.getString("ticket"),
result.getLong("expires_in") * 1000l).pushExtra("group_id",
result.getString("group_id"));
}
}
代码示例来源:origin: foxinmy/weixin4j
return new MediaUploadResult(obj.getString("media_id"),
obj.getObject("type", MediaType.class), new Date(
obj.getLong("created_at") * 1000l),
obj.getString("url"));
代码示例来源:origin: foxinmy/weixin4j
return new MediaUploadResult(obj.getString("media_id"),
obj.getObject("type", MediaType.class), new Date(
obj.getLong("created_at") * 1000l),
obj.getString("url"));
代码示例来源:origin: com.github.ltsopensource/lts-core
@Override
public Long getLong(String key) {
return jsonObject.getLong(key);
}
代码示例来源:origin: whvcse/EasyWeb
/**
* 得到Long类型的值
*/
public static long getLong(String json, String key) {
Long result = null;
try {
JSONObject jsonObject = JSON.parseObject(json);
result = jsonObject.getLong(key);
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
代码示例来源:origin: cn.leancloud/realtime-core
@Override
protected void parseAdditionalMetaData(final Map<String, Object> meta, JSONObject formatInfo) {
if (null == meta || null == formatInfo) {
return;
}
String fileFormat = formatInfo.getString("format_name");
Double durationInDouble = formatInfo.getDouble("duration");
long size = formatInfo.getLong(FILE_SIZE);
meta.put(FILE_SIZE, size);
meta.put(DURATION, durationInDouble);
meta.put(FORMAT, fileFormat);
}
代码示例来源:origin: cn.leancloud/realtime-core
@Override
protected void parseAdditionalMetaData(final Map<String, Object> meta, JSONObject formatInfo) {
if (null == meta || null == formatInfo) {
return;
}
String fileFormat = formatInfo.getString("format_name");
Double durationInDouble = formatInfo.getDouble("duration");
long size = formatInfo.getLong(FILE_SIZE);
meta.put(FILE_SIZE, size);
meta.put(DURATION, durationInDouble);
meta.put(FORMAT, fileFormat);
}
}
代码示例来源:origin: JoleneOL/market-manage
@PostMapping("/wechatSearch/goodsList")
public String cartGoodsList(@RequestParam String order, Model model) {
Map<MainGood, Long> cartGoodsMap = new HashMap<>();
JSONObject object = JSONObject.parseObject(order);
object.keySet().forEach(key -> {
MainGood mainGood = mainGoodService.findOne(Long.valueOf(key));
if (mainGood != null) {
cartGoodsMap.put(mainGood, object.getLong(key));
}
});
model.addAttribute("goodsMap", cartGoodsMap);
return "wechat@mall/cart.html";
}
代码示例来源:origin: ucarGroup/DataLink
@Override
public SearchResultDetailVO parseData(JSONObject json) {
SearchResultDetailVO resultVo;
resultVo = new SearchResultDetailVO();
resultVo.setIndex(json.getString(ParseHandler.INDEX_NAME));
resultVo.setType(json.getString(ParseHandler.TYPE_NAME));
resultVo.setId(json.getString(ParseHandler.ID_NAME));
resultVo.setVersion(json.getLong(ParseHandler.VERSION_NAME));
resultVo.setResult(json.getString(ParseHandler.SOURCE_NAME));
return resultVo;
}
内容来源于网络,如有侵权,请联系作者删除!