Apache Flink input format library for parsing Twitter JSON data into structured Tweet objects for stream processing applications
Twitter user profile information including demographics, account settings, follower metrics, and profile customization data.
Complete Twitter user profile information representing a Twitter account with all associated metadata, settings, and metrics.
/**
* Represents a complete Twitter user profile with all associated metadata.
* Contains demographic information, account settings, and social metrics.
*/
public class Users {
/**
* Default constructor that initializes and resets all fields.
*/
public Users();
/**
* Reset all fields for object reuse (Kryo serialization optimization).
*/
public void reset();
// User identification
/**
* Get the unique identifier of the user.
* @return User ID as long
*/
public long getId();
/**
* Set the unique identifier of the user.
* @param id User ID as long
*/
public void setId(long id);
/**
* Get the string representation of the user ID.
* @return User ID as string (computed from numeric ID)
*/
public String getId_str();
/**
* Set the string representation of the user ID.
* @param id_str User ID as string
*/
public void setId_str(String id_str);
/**
* Get the user's screen name (handle).
* @return Screen name without @ symbol
*/
public String getScreen_name();
/**
* Set the user's screen name (handle).
* @param screen_name Screen name without @ symbol
*/
public void setScreen_name(String screen_name);
/**
* Get the user's display name.
* @return Display name
*/
public String getName();
/**
* Set the user's display name.
* @param name Display name
*/
public void setName(String name);
// Profile information
/**
* Get the user's profile description/bio.
* @return Profile description
*/
public String getDescription();
/**
* Set the user's profile description/bio.
* @param description Profile description
*/
public void setDescription(String description);
/**
* Get the user's location information.
* @return Location string
*/
public String getLocation();
/**
* Set the user's location information.
* @param location Location string
*/
public void setLocation(String location);
/**
* Get the user's profile URL.
* @return Profile URL
*/
public String getUrl();
/**
* Set the user's profile URL.
* @param url Profile URL
*/
public void setUrl(String url);
/**
* Check if the user account is verified.
* @return true if verified
*/
public boolean isVerified();
/**
* Set whether the user account is verified.
* @param verified true if verified
*/
public void setVerified(boolean verified);
/**
* Check if the user's tweets are protected.
* @return true if protected
*/
public boolean isProtected_tweet();
/**
* Set whether the user's tweets are protected.
* @param protected_tweet true if protected
*/
public void setProtected_tweet(boolean protected_tweet);
/**
* Get the user's preferred language.
* @return ISO 639-1 language code
*/
public String getLang();
/**
* Set the user's preferred language.
* @param lang ISO 639-1 language code
*/
public void setLang(String lang);
// Account metrics
/**
* Get the number of followers this user has.
* @return Follower count
*/
public long getFollowers_count();
/**
* Set the number of followers this user has.
* @param followers_count Follower count
*/
public void setFollowers_count(long followers_count);
/**
* Get the number of users this user is following.
* @return Following count (friends)
*/
public long getFriends_count();
/**
* Set the number of users this user is following.
* @param friends_count Following count (friends)
*/
public void setFriends_count(long friends_count);
/**
* Get the number of public lists this user is a member of.
* @return Listed count
*/
public long getListed_count();
/**
* Set the number of public lists this user is a member of.
* @param listed_count Listed count
*/
public void setListed_count(long listed_count);
/**
* Get the number of tweets this user has liked.
* @return Favourites count
*/
public long getFavourites_count();
/**
* Set the number of tweets this user has liked.
* @param favourites_count Favourites count
*/
public void setFavourites_count(long favourites_count);
/**
* Get the number of tweets posted by this user.
* @return Status count
*/
public long getStatuses_count();
/**
* Set the number of tweets posted by this user.
* @param statuses_count Status count
*/
public void setStatuses_count(long statuses_count);
// Account timestamps and settings
/**
* Get the account creation timestamp.
* @return Creation timestamp in Twitter format
*/
public String getCreated_at();
/**
* Set the account creation timestamp.
* @param created_at Creation timestamp in Twitter format
*/
public void setCreated_at(String created_at);
/**
* Get the user's UTC offset in seconds.
* @return UTC offset in seconds
*/
public long getUtc_offset();
/**
* Set the user's UTC offset in seconds.
* @param utc_offset UTC offset in seconds
*/
public void setUtc_offset(long utc_offset);
/**
* Get the user's time zone name.
* @return Time zone name
*/
public String getTime_zone();
/**
* Set the user's time zone name.
* @param time_zone Time zone name
*/
public void setTime_zone(String time_zone);
/**
* Check if the user has enabled geotagging.
* @return true if geo-enabled
*/
public boolean isGeo_enabled();
/**
* Set whether the user has enabled geotagging.
* @param geo_enabled true if geo-enabled
*/
public void setGeo_enabled(boolean geo_enabled);
// Account capabilities and settings
/**
* Check if contributors are enabled for this account.
* @return true if contributors enabled
*/
public boolean isContributors_enabled();
/**
* Set whether contributors are enabled for this account.
* @param contributors_enabled true if contributors enabled
*/
public void setContributors_enabled(boolean contributors_enabled);
/**
* Check if the user is a translator.
* @return true if translator
*/
public boolean isIs_translator();
/**
* Set whether the user is a translator.
* @param is_translator true if translator
*/
public void setIs_translator(boolean is_translator);
// Profile appearance
/**
* Get the profile background color.
* @return Hex color code
*/
public String getProfile_background_color();
/**
* Set the profile background color.
* @param profile_background_color Hex color code
*/
public void setProfile_background_color(String profile_background_color);
/**
* Get the profile background image URL.
* @return Background image URL
*/
public String getProfile_background_image_url();
/**
* Set the profile background image URL.
* @param profile_background_image_url Background image URL
*/
public void setProfile_background_image_url(String profile_background_image_url);
/**
* Get the HTTPS profile background image URL.
* @return HTTPS background image URL
*/
public String getProfile_background_image_url_https();
/**
* Set the HTTPS profile background image URL.
* @param profile_background_image_url_https HTTPS background image URL
*/
public void setProfile_background_image_url_https(String profile_background_image_url_https);
/**
* Check if the background image should be tiled.
* @return true if background tiled
*/
public boolean isProfile_background_tile();
/**
* Set whether the background image should be tiled.
* @param profile_background_tile true if background tiled
*/
public void setProfile_background_tile(boolean profile_background_tile);
/**
* Get the profile link color.
* @return Hex color code
*/
public String getProfile_link_color();
/**
* Set the profile link color.
* @param profile_link_color Hex color code
*/
public void setProfile_link_color(String profile_link_color);
/**
* Get the profile sidebar border color.
* @return Hex color code
*/
public String getProfile_sidebar_border_color();
/**
* Set the profile sidebar border color.
* @param profile_sidebar_border_color Hex color code
*/
public void setProfile_sidebar_border_color(String profile_sidebar_border_color);
/**
* Get the profile sidebar fill color.
* @return Hex color code
*/
public String getProfile_sidebar_fill_color();
/**
* Set the profile sidebar fill color.
* @param profile_sidebar_fill_color Hex color code
*/
public void setProfile_sidebar_fill_color(String profile_sidebar_fill_color);
/**
* Get the profile text color.
* @return Hex color code
*/
public String getProfile_text_color();
/**
* Set the profile text color.
* @param profile_text_color Hex color code
*/
public void setProfile_text_color(String profile_text_color);
/**
* Check if the profile uses background image.
* @return true if using background image
*/
public boolean isProfile_use_background_image();
/**
* Set whether the profile uses background image.
* @param profile_use_background_image true if using background image
*/
public void setProfile_use_background_image(boolean profile_use_background_image);
/**
* Get the profile image URL.
* @return Profile image URL
*/
public String getProfile_image_url();
/**
* Set the profile image URL.
* @param profile_image_url Profile image URL
*/
public void setProfile_image_url(String profile_image_url);
/**
* Get the HTTPS profile image URL.
* @return HTTPS profile image URL
*/
public String getProfile_image_url_https();
/**
* Set the HTTPS profile image URL.
* @param profile_image_url_https HTTPS profile image URL
*/
public void setProfile_image_url_https(String profile_image_url_https);
/**
* Get the profile banner URL.
* @return Profile banner URL
*/
public String getProfile_banner_url();
/**
* Set the profile banner URL.
* @param profile_banner_url Profile banner URL
*/
public void setProfile_banner_url(String profile_banner_url);
/**
* Check if using the default profile theme.
* @return true if default profile
*/
public boolean isDefault_profile();
/**
* Set whether using the default profile theme.
* @param default_profile true if default profile
*/
public void setDefault_profile(boolean default_profile);
/**
* Check if using the default profile image.
* @return true if default profile image
*/
public boolean isDefault_profile_image();
/**
* Set whether using the default profile image.
* @param default_profile_image true if default profile image
*/
public void setDefault_profile_image(boolean default_profile_image);
// Relationship status (from authenticated user's perspective)
/**
* Check if the authenticated user is following this user.
* @return true if following
*/
public boolean isFollowing();
/**
* Set whether the authenticated user is following this user.
* @param following true if following
*/
public void setFollowing(boolean following);
/**
* Check if a follow request has been sent to this user.
* @return true if follow request sent
*/
public boolean isFollow_request_sent();
/**
* Set whether a follow request has been sent to this user.
* @param follow_request_sent true if follow request sent
*/
public void setFollow_request_sent(boolean follow_request_sent);
/**
* Check if notifications are enabled for this user.
* @return true if notifications enabled
*/
public boolean isNotifications();
/**
* Set whether notifications are enabled for this user.
* @param notifications true if notifications enabled
*/
public void setNotifications(boolean notifications);
/**
* Get the entities parsed from user profile fields.
* @return Entities object containing URLs from profile
*/
public Entities getEntities();
/**
* Set the entities parsed from user profile fields.
* @param entities Entities object containing URLs from profile
*/
public void setEntities(Entities entities);
}Usage Examples:
import org.apache.flink.contrib.tweetinputformat.model.User.Users;
// Basic user information
Users user = tweet.getUser();
System.out.println("User: @" + user.getScreen_name() + " (" + user.getName() + ")");
System.out.println("Bio: " + user.getDescription());
System.out.println("Location: " + user.getLocation());
System.out.println("Followers: " + user.getFollowers_count());
System.out.println("Following: " + user.getFriends_count());
// Account verification and protection
if (user.isVerified()) {
System.out.println("✓ Verified account");
}
if (user.isProtected_tweet()) {
System.out.println("🔒 Protected tweets");
}
// Account age and activity
System.out.println("Member since: " + user.getCreated_at());
System.out.println("Total tweets: " + user.getStatuses_count());
System.out.println("Total likes: " + user.getFavourites_count());
// Profile customization
if (!user.isDefault_profile()) {
System.out.println("Custom profile theme");
System.out.println("Background color: #" + user.getProfile_background_color());
System.out.println("Link color: #" + user.getProfile_link_color());
}
// Profile images
System.out.println("Profile image: " + user.getProfile_image_url_https());
if (!user.getProfile_banner_url().isEmpty()) {
System.out.println("Banner image: " + user.getProfile_banner_url());
}
// Geographic and language settings
if (user.isGeo_enabled()) {
System.out.println("Geotagging enabled");
}
System.out.println("Language: " + user.getLang());
if (!user.getTime_zone().isEmpty()) {
System.out.println("Time zone: " + user.getTime_zone());
}Common patterns for analyzing user data in stream processing:
// High-influence users
tweets.filter(tweet -> {
Users user = tweet.getUser();
return user.isVerified() && user.getFollowers_count() > 100000;
});
// Active users
tweets.filter(tweet -> {
Users user = tweet.getUser();
return user.getStatuses_count() > 1000 &&
user.getFriends_count() > 100;
});
// Geographic analysis
tweets.filter(tweet -> {
Users user = tweet.getUser();
return user.isGeo_enabled() &&
!user.getLocation().isEmpty();
});
// Account age analysis
tweets.map(tweet -> {
Users user = tweet.getUser();
// Parse created_at and calculate account age
return new UserMetrics(
user.getScreen_name(),
parseTwitterDate(user.getCreated_at()),
user.getFollowers_count(),
user.getStatuses_count()
);
});Install with Tessl CLI
npx tessl i tessl/maven-org-apache-flink--flink-tweet-inputformat-2-11