Example usage for twitter4j User isProtected

List of usage examples for twitter4j User isProtected

Introduction

In this page you can find the example usage for twitter4j User isProtected.

Prototype

boolean isProtected();

Source Link

Document

Test if the user status is protected

Usage

From source file:twitbak.TwitBak.java

License:Open Source License

/**
 * Returns a JSONObject containing user data.
 * @param user/* w w w .  ja v  a 2  s . c om*/
 * @return
 * @throws TwitterException
 * @throws JSONException
 */
//TODO - should be void to match other Bak classes 
static JSONObject userToJson(User user) throws TwitterException, JSONException {
    JSONObject result = new JSONObject();
    JSONObject userData = new JSONObject();
    userData.put("ID", user.getId());
    userData.put("Screen Name", user.getScreenName());
    userData.put("Name", user.getName());
    userData.put("Description", user.getDescription());
    userData.put("Profile Image URL", user.getProfileImageURL());
    userData.put("URL", user.getURL());
    userData.put("Protected", user.isProtected());
    userData.put("Followers", user.getFollowersCount());
    userData.put("Created At", user.getCreatedAt().toString());
    userData.put("Favorites", user.getFavouritesCount());
    userData.put("Friends", user.getFriendsCount());
    userData.put("Location", user.getLocation());
    userData.put("Statuses", user.getStatusesCount());
    userData.put("Profile Background Color", user.getProfileBackgroundColor());
    userData.put("Profile Background Image URL", user.getProfileBackgroundImageUrl());
    userData.put("Profile Sidebar Border Color", user.getProfileSidebarBorderColor());
    userData.put("Profile Sidebar Fill Color", user.getProfileSidebarFillColor());
    userData.put("Profile Text Color", user.getProfileTextColor());
    userData.put("Time Zone", user.getTimeZone());
    result.put("User data", userData);
    return result;
}