Overview
TheProfile_Model class represents a user profile in the Threadly application. It contains user information, statistics, and relationship status with other users.
Fields
Unique identifier for the user
The user’s username/display name
URL to the user’s profile picture
User’s biography/about text
Date of birth of the user
Number of followers the user has
Number of accounts the user is following
Total number of posts created by the user
Whether this user follows the current user
Whether the current user follows this user
Whether the user’s profile is private (requires follow approval)
Whether a follow request to this user has been approved
Methods
The model provides standard getter and setter methods for all fields:getUserid()/setUserid(String)getUsername()/setUsername(String)getProfilepic()/setProfilepic(String)getBio()/setBio(String)getDob()/setDob(String)getFollowers()/setFollowers(int)getFollowing()/setFollowing(int)getPosts()/setPosts(int)isFollowingMe()/setFollowingMe(boolean)isFollowedByMe()/setFollowedByMe(boolean)isPrivate()/setPrivate(boolean)isFollowRequestApproved()/setFollowRequestApproved(boolean)
Constructors
The model has two constructors:Basic Constructor
Accepts basic profile information and follow status:Extended Constructor
Includes privacy settings:Example
Usage Notes
- The
isFollowedByMeandisFollowingMefields are derived from integer values during construction (>0 = true) - The
isPrivatefield determines whether the user’s content requires follow approval to view - The
isFollowRequestApprovedfield is only relevant whenisPrivateis true and indicates whether a pending follow request has been approved - Profile statistics (
followers,following,posts) are updated as the user’s activity changes