本文整理了Java中org.json.simple.JSONObject.clone()
方法的一些代码示例,展示了JSONObject.clone()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONObject.clone()
方法的具体详情如下:
包路径:org.json.simple.JSONObject
类名称:JSONObject
方法名:clone
暂无
代码示例来源:origin: apache/metron
@Override
public JSONObject get(Tuple tuple) {
return (JSONObject) ((JSONObject) tuple.getValueByField(fieldValue)).clone();
}
}
代码示例来源:origin: apache/metron
private JSONObject getMessage(Tuple tuple) {
Object ret = tuple.getValueByField("message");
if(ret != null) {
ret = tuple.getValue(0);
}
if(ret != null) {
return (JSONObject)((JSONObject)ret).clone();
}
else {
return null;
}
}
代码示例来源:origin: apache/metron
@Before
public void parseMessages() throws ParseException {
JSONParser parser = new JSONParser();
fullMessageList = new ArrayList<>();
sampleMessage = (JSONObject) parser.parse(sampleMessageString);
sampleMessage.put("field", "value1");
fullMessageList.add(((JSONObject) sampleMessage.clone()));
sampleMessage.put("field", "value2");
fullMessageList.add(((JSONObject) sampleMessage.clone()));
sampleMessage.put("field", "value3");
fullMessageList.add(((JSONObject) sampleMessage.clone()));
sampleMessage.put("field", "value4");
fullMessageList.add(((JSONObject) sampleMessage.clone()));
sampleMessage.put("field", "value5");
fullMessageList.add(((JSONObject) sampleMessage.clone()));
}
内容来源于网络,如有侵权,请联系作者删除!