Class User

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

public class User extends Object
Model class representing a user in the system.

Target Firestore path: users/{userId}

  • Constructor Details

    • User

      public User()
      Default constructor required for Firestore.
    • User

      public User(String userId, String username, String email, String phone)
      Convenience constructor for basic profile information with userId.
    • User

      public User(String userId, String deviceId, String email, String phone, String username, String role, com.google.firebase.firestore.GeoPoint location, boolean notificationsEnabled, com.google.firebase.Timestamp createdAt, com.google.firebase.Timestamp updatedAt, List<String> interests)
      Full constructor.
  • Method Details

    • getUserId

      public String getUserId()
    • setUserId

      public void setUserId(String userId)
    • getDeviceId

      public String getDeviceId()
    • setDeviceId

      public void setDeviceId(String deviceId)
    • getEmail

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

      public void setEmail(String email)
    • getPhone

      public String getPhone()
    • setPhone

      public void setPhone(String phone)
    • getUsername

      public String getUsername()
    • setUsername

      public void setUsername(String username)
    • getRole

      public String getRole()
    • setRole

      public void setRole(String role)
    • getLocation

      public com.google.firebase.firestore.GeoPoint getLocation()
    • setLocation

      public void setLocation(com.google.firebase.firestore.GeoPoint location)
    • isGeolocationEnabled

      public boolean isGeolocationEnabled()
    • setGeolocationEnabled

      public void setGeolocationEnabled(boolean geolocationEnabled)
    • isNotificationsEnabled

      public boolean isNotificationsEnabled()
    • setNotificationsEnabled

      public void setNotificationsEnabled(boolean notificationsEnabled)
    • getCreatedAt

      public com.google.firebase.Timestamp getCreatedAt()
    • setCreatedAt

      public void setCreatedAt(com.google.firebase.Timestamp createdAt)
    • getUpdatedAt

      public com.google.firebase.Timestamp getUpdatedAt()
    • setUpdatedAt

      public void setUpdatedAt(com.google.firebase.Timestamp updatedAt)
    • getInterests

      public List<String> getInterests()
    • setInterests

      public void setInterests(List<String> interests)
    • getProfileImageBase64

      public String getProfileImageBase64()
    • setProfileImageBase64

      public void setProfileImageBase64(String profileImageBase64)
    • isEntrant

      public boolean isEntrant()
    • isOrganizer

      public boolean isOrganizer()
    • isAdmin

      public boolean isAdmin()
    • touch

      public void touch()
      Updates the updatedAt timestamp. Should be called explicitly before Firestore writes.