java.lang.Object
com.example.iconic_raffleevent.model.User

public class User extends Object
Represents a user in the system. Each user is associated with their device using a unique user ID. Users can provide optional details like email, phone, and a profile image. Users can also have multiple roles, such as "entrant" or "organizer."
  • Constructor Details

    • User

      public User()
      Default constructor initializing user with default values. Initializes lists for event IDs and roles, and sets default notification preferences.
  • Method Details

    • getUserId

      public String getUserId()
      Gets the unique user ID.
      Returns:
      The user ID as a String.
    • setUserId

      public void setUserId(String userId)
      Sets the user ID.
      Parameters:
      userId - The user ID to set.
    • getUsername

      public String getUsername()
      Gets the username.
      Returns:
      The username as a String.
    • setUsername

      public void setUsername(String username)
      Sets the username.
      Parameters:
      username - The username to set.
    • getName

      public String getName()
      Gets the user's name.
      Returns:
      The user's name as a String.
    • setName

      public void setName(String name)
      Sets the user's name.
      Parameters:
      name - The name to set for the user.
    • getEmail

      public String getEmail()
      Gets the user's email address.
      Returns:
      The user's email as a String.
    • setEmail

      public void setEmail(String email)
      Sets the user's email address.
      Parameters:
      email - The email to set for the user.
    • getPhoneNo

      public String getPhoneNo()
      Gets the user's phone number.
      Returns:
      The user's phone number as a String.
    • setPhoneNo

      public void setPhoneNo(String phoneNo)
      Sets the user's phone number.
      Parameters:
      phoneNo - The phone number to set for the user.
    • getProfileImageUrl

      public String getProfileImageUrl()
      Gets the URL of the user's profile image.
      Returns:
      The profile image URL as a String.
    • setProfileImageUrl

      public void setProfileImageUrl(String profileImageUrl)
      Sets the URL of the user's profile image.
      Parameters:
      profileImageUrl - The URL to set for the user's profile image.
    • isLocationPermission

      public boolean isLocationPermission()
      Gets the user's location permission status.
      Returns:
      True if location permission is granted, false otherwise.
    • setLocationPermission

      public void setLocationPermission(boolean locationPermission)
      Sets the user's location permission status.
      Parameters:
      locationPermission - The location permission status to set.
    • getWaitingListEventIds

      public List<String> getWaitingListEventIds()
      Gets the list of event IDs the user is waiting for.
      Returns:
      The list of waiting event IDs.
    • setWaitingListEventIds

      public void setWaitingListEventIds(List<String> waitingListEventIds)
      Sets the list of event IDs the user is waiting for.
      Parameters:
      waitingListEventIds - The list of waiting event IDs to set.
    • addWaitingListEvent

      public void addWaitingListEvent(String eventId)
      Adds an event ID to the user's waiting list.
      Parameters:
      eventId - The event ID to add to the waiting list.
    • getRegisteredEventIds

      public List<String> getRegisteredEventIds()
      Gets the list of event IDs the user is registered for.
      Returns:
      The list of registered event IDs.
    • setRegisteredEventIds

      public void setRegisteredEventIds(List<String> registeredEventIds)
      Sets the list of event IDs the user is registered for.
      Parameters:
      registeredEventIds - The list of registered event IDs to set.
    • addRegisteredEvent

      public void addRegisteredEvent(String eventId)
      Adds an event ID to the user's registered events.
      Parameters:
      eventId - The event ID to add to the registered events list.
    • isGeneralNotificationPref

      public boolean isGeneralNotificationPref()
      Checks if the user has opted for general notifications.
      Returns:
      True if general notifications are enabled, false otherwise.
    • setGeneralNotificationPref

      public void setGeneralNotificationPref(boolean generalNotificationPref)
      Sets the general notifications preference for the user.
      Parameters:
      generalNotificationPref - The general notification preference to set.
    • getFacilityId

      public String getFacilityId()
      Gets the facility ID associated with the user.
      Returns:
      The facility ID as a String.
    • setFacilityId

      public void setFacilityId(String facilityId)
      Sets the facility ID for the user.
      Parameters:
      facilityId - The facility ID to set.
    • getRoles

      public List<String> getRoles()
      Gets the roles associated with the user.
      Returns:
      A list of roles the user has.
    • addRole

      public void addRole(String role)
      Adds a role to the user.
      Parameters:
      role - The role to add.
    • removeRole

      public void removeRole(String role)
      Removes a role from the user.
      Parameters:
      role - The role to remove.
    • checkAdminRole

      public boolean checkAdminRole()
      Checks if the user has the admin role.
      Returns:
      True if the user has the "admin" role, false otherwise.