Package facebook4j.internal.org.json

Examples of facebook4j.internal.org.json.JSONObject.keys()


        }
        try {
            JSONObject jsonObject = json.getJSONObject(name);
            HashMap<String, String> result = new HashMap<String, String>();
            @SuppressWarnings("unchecked")
            Iterator<String> keys = jsonObject.keys();
            while (keys.hasNext()) {
                String key = (String) keys.next();
                result.put(key, jsonObject.getString(key));
            }
            return result;
View Full Code Here


        }
        try {
            JSONObject jsonObject = json.getJSONObject(name);
            HashMap<String, Long> result = new HashMap<String, Long>();
            @SuppressWarnings("unchecked")
            Iterator<String> keys = jsonObject.keys();
            while (keys.hasNext()) {
                String key = (String) keys.next();
                result.put(key, jsonObject.getLong(key));
            }
            return result;
View Full Code Here

        }
        try {
            JSONObject jsonObject = json.getJSONObject(name);
            HashMap<String, Boolean> result = new HashMap<String, Boolean>();
            @SuppressWarnings("unchecked")
            Iterator<String> keys = jsonObject.keys();
            while (keys.hasNext()) {
                String key = (String) keys.next();
                result.put(key, jsonObject.getBoolean(key));
            }
            return result;
View Full Code Here

        ensureAuthorizationEnabled();
        String _userIds = z_F4JInternalStringUtil.join(userIds.toArray(new String[userIds.size()]), ",");
        HttpResponse res = post(buildEndpoint(pageId, "blocked"), new HttpParameter[]{new HttpParameter("uid", _userIds)});
        Map<String, Boolean> blocks = new HashMap<String, Boolean>();
        JSONObject jsonObject = res.asJSONObject();
        Iterator<String> uids = jsonObject.keys();
        while (uids.hasNext()) {
            String uid = uids.next();
            boolean result = getBoolean(uid, jsonObject);
            blocks.put(uid, result);
        }
View Full Code Here

            if (conf.isJSONStoreEnabled()) {
                DataObjectFactoryUtil.clearThreadLocalMap();
            }
            JSONObject json = res.asJSONObject();
            List<User> users = new ArrayList<User>();
            Iterator ids = json.keys();
            while (ids.hasNext()) {
                String id = (String) ids.next();
                User user = new UserJSONImpl((JSONObject) json.get(id));
                users.add(user);
            }
View Full Code Here

            if (conf.isJSONStoreEnabled()) {
                DataObjectFactoryUtil.clearThreadLocalMap();
            }
            JSONObject json = res.asJSONObject();
            List<Domain> domains = new ArrayList<Domain>();
            Iterator ids = json.keys();
            while (ids.hasNext()) {
                String id = (String) ids.next();
                JSONObject domainJSONObject = (JSONObject) json.get(id);
                Domain domain = new DomainJSONImpl(domainJSONObject);
                if (conf.isJSONStoreEnabled()) {
View Full Code Here

        JSONObject json = res.asJSONObject();
        try {
            JSONArray list = json.getJSONArray("data");
            for (int i = 0; i < list.length(); i++) {
                JSONObject permissionJSONObject = list.getJSONObject(i);
                Iterator<String> permissionNames = permissionJSONObject.keys();
                while (permissionNames.hasNext()) {
                    String permissionName = permissionNames.next();
                    boolean isGranted = getFlag(permissionName, permissionJSONObject);
                    permissions.add(new PermissionJSONImpl(permissionName, isGranted));
                }
View Full Code Here

            assertThat(actual1, is(nullValue()));

            BatchResponse actual2 = actuals.get(1);
            assertThat(actual2.getStatusCode(), is(200));
            JSONObject jsonObject = actual2.asJSONObject();
            Iterator keys = jsonObject.keys();
            String key1 = (String) keys.next();
            Friend friend1 = DataObjectFactory.createFriend(jsonObject.getString(key1));
            assertThat(friend1.getId(), is("500000001"));
            String key2 = (String) keys.next();
            Friend friend2 = DataObjectFactory.createFriend(jsonObject.getString(key2));
View Full Code Here

            assertThat(responseList.get(1).getString("id"), is("500000002"));

            BatchResponse actual2 = actuals.get(1);
            assertThat(actual2.getStatusCode(), is(200));
            JSONObject jsonObject = actual2.asJSONObject();
            Iterator keys = jsonObject.keys();
            String key1 = (String) keys.next();
            Friend friend1 = DataObjectFactory.createFriend(jsonObject.getString(key1));
            assertThat(friend1.getId(), is("500000001"));
            String key2 = (String) keys.next();
            Friend friend2 = DataObjectFactory.createFriend(jsonObject.getString(key2));
View Full Code Here

                        JSONObject tagJSONObject = tagsJSONArray.getJSONObject(i);
                        messageTags.add(new TagJSONImpl(tagJSONObject));
                    }
                } else {
                    JSONObject tagsJSONObject = json.getJSONObject("message_tags");
                    Iterator ids = tagsJSONObject.keys();
                    while (ids.hasNext()) {
                        String id = (String) ids.next();
                        JSONArray tagsJSONArray = tagsJSONObject.getJSONArray(id);
                        messageTags = new ArrayList<Tag>();
                        for (int i = 0; i < tagsJSONArray.length(); i++) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.