本文整理匯總了Java中org.json.simple.JSONObject.size方法的典型用法代碼示例。如果您正苦於以下問題:Java JSONObject.size方法的具體用法?Java JSONObject.size怎麽用?Java JSONObject.size使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.json.simple.JSONObject
的用法示例。
在下文中一共展示了JSONObject.size方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: parseFavouriteSites
import org.json.simple.JSONObject; //導入方法依賴的package包/類
public static ListResponse<FavouriteSite> parseFavouriteSites(JSONObject jsonObject)
{
JSONObject jsonList = (JSONObject)jsonObject.get("list");
List<FavouriteSite> favouriteSites = new ArrayList<FavouriteSite>(jsonList.size());
if(jsonList != null)
{
JSONArray jsonEntries = (JSONArray)jsonList.get("entries");
if(jsonEntries != null)
{
for(int i = 0; i < jsonEntries.size(); i++)
{
JSONObject jsonEntry = (JSONObject)jsonEntries.get(i);
JSONObject entry = (JSONObject)jsonEntry.get("entry");
favouriteSites.add(parseFavouriteSite(entry));
}
}
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
return new ListResponse<FavouriteSite>(paging, favouriteSites);
}
示例2: getAllCredentials
import org.json.simple.JSONObject; //導入方法依賴的package包/類
public List<Credentials> getAllCredentials() throws IOException {
JSONObject currentAuths;
synchronized (this) {
loadCache();
currentAuths = auths;
}
List<Credentials> ret = new ArrayList<>(currentAuths.size());
for (Iterator it = currentAuths.entrySet().iterator(); it.hasNext();) {
Map.Entry e = (Map.Entry) it.next();
if (!(e.getKey() instanceof String)) {
continue;
}
String registry = (String) e.getKey();
JSONObject value = (JSONObject) e.getValue();
if (value == null) {
continue;
}
ret.add(createCredentials(registry, value)); // NOI18N
}
return ret;
}
示例3: Command
import org.json.simple.JSONObject; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public Command(String method, JSONObject params) {
command = new JSONObject();
command.put(COMMAND_ID, createUniqueID());
command.put(COMMAND_METHOD, method);
if (params != null && params.size() > 0) {
command.put(COMMAND_PARAMS, params);
}
}
示例4: createHar
import org.json.simple.JSONObject; //導入方法依賴的package包/類
@SuppressWarnings("rawtypes")
private void createHar(String pt, String rt) {
Har<String, Log> har = new Har<>();
Page p = new Page(pt, har.pages());
har.addPage(p);
for (Object res : (JSONArray) JSONValue.parse(rt)) {
JSONObject jse = (JSONObject) res;
if (jse.size() > 14) {
Entry e = new Entry(jse.toJSONString(), p);
har.addEntry(e);
}
}
har.addRaw(pt, rt);
Control.ReportManager.addHar(har, (TestCaseReport) Report,
escapeName(Data));
}
示例5: getAchievements
import org.json.simple.JSONObject; //導入方法依賴的package包/類
public int getAchievements(){
JSONObject obj = (JSONObject) object("achievements");
return obj.size() - 1;
}