Android Open Source - Android-VKontakte-SDK Group Ban Item






From Project

Back to project page Android-VKontakte-SDK.

License

The source code is released under:

MIT License

If you think the Android project Android-VKontakte-SDK listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.perm.kate.api;
/*from ww  w  .  j a  v  a  2s  .  c  o m*/
import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class GroupBanItem {
    
    public long id; // TODO for v5.0 - id
    public String first_name;
    public String last_name;
    public String photo_100; //not documented
    public BanInfo banInfo;
    
    public static GroupBanItem parse(JSONObject o) throws NumberFormatException, JSONException {
        GroupBanItem item = new GroupBanItem();
        if (o.isNull("id"))
            return null;  //TODO skip group, so as no full info
        item.id = Long.parseLong(o.getString("id"));
        if (!o.isNull("first_name"))
            item.first_name = o.optString("first_name");
        if (!o.isNull("last_name"))
            item.last_name = o.optString("last_name");
        if (!o.isNull("photo_100"))
            item.photo_100 = o.optString("photo_100");
        if (!o.isNull("ban_info")) {
            JSONObject object = o.optJSONObject("ban_info");
            if (object != null)
                item.banInfo = BanInfo.parse(object);
        }
        return item;
    }
    
    public static ArrayList<GroupBanItem> parseAll(JSONArray array) throws NumberFormatException, JSONException {
        ArrayList<GroupBanItem> items = new ArrayList<GroupBanItem>();
        if (array == null)
            return items;
        int category_count = array.length();
        for (int i = 0; i < category_count; ++i) {
            if (!(array.get(i) instanceof JSONObject))
                continue;
            JSONObject o = (JSONObject)array.get(i);
            GroupBanItem item = parse(o);
            if (item == null || item.id == 0)
                continue; //TODO skip group, so as no full info 
            items.add(item);
        }
        return items;
    }
}




Java Source Code List

com.perm.kate.api.Album.java
com.perm.kate.api.Api.java
com.perm.kate.api.Attachment.java
com.perm.kate.api.AudioAlbum.java
com.perm.kate.api.Audio.java
com.perm.kate.api.Auth.java
com.perm.kate.api.BanInfo.java
com.perm.kate.api.BannArg.java
com.perm.kate.api.City.java
com.perm.kate.api.CommentList.java
com.perm.kate.api.Comment.java
com.perm.kate.api.Constants.java
com.perm.kate.api.Contact.java
com.perm.kate.api.Counters.java
com.perm.kate.api.Country.java
com.perm.kate.api.Document.java
com.perm.kate.api.FriendsList.java
com.perm.kate.api.Geo.java
com.perm.kate.api.Gift.java
com.perm.kate.api.Graffiti.java
com.perm.kate.api.GroupBanItem.java
com.perm.kate.api.GroupTopic.java
com.perm.kate.api.Group.java
com.perm.kate.api.IdsPair.java
com.perm.kate.api.KException.java
com.perm.kate.api.LastActivity.java
com.perm.kate.api.Link.java
com.perm.kate.api.Media.java
com.perm.kate.api.Message.java
com.perm.kate.api.NameCases.java
com.perm.kate.api.NewsItem.java
com.perm.kate.api.NewsJTags.java
com.perm.kate.api.NewsTypes.java
com.perm.kate.api.Newsfeed.java
com.perm.kate.api.Note.java
com.perm.kate.api.Notification.java
com.perm.kate.api.Notifications.java
com.perm.kate.api.Page.java
com.perm.kate.api.Params.java
com.perm.kate.api.PhotoComment.java
com.perm.kate.api.PhotoTag.java
com.perm.kate.api.Photo.java
com.perm.kate.api.Place.java
com.perm.kate.api.Reply.java
com.perm.kate.api.SearchDialogItem.java
com.perm.kate.api.User.java
com.perm.kate.api.Video.java
com.perm.kate.api.VkApp.java
com.perm.kate.api.VkPollAnswer.java
com.perm.kate.api.VkPoll.java
com.perm.kate.api.VkStatus.java
com.perm.kate.api.WallMessage.java
com.perm.kate.api.sample.Account.java
com.perm.kate.api.sample.Constants.java
com.perm.kate.api.sample.LoginActivity.java
com.perm.kate.api.sample.MainActivity.java
com.perm.utils.Utils.java
com.perm.utils.WrongResponseCodeException.java