Package com.example.lottery.model
Class User
java.lang.Object
com.example.lottery.model.User
Model class representing a user in the system.
Target Firestore path: users/{userId}
-
Constructor Summary
ConstructorsConstructorDescriptionUser()Default constructor required for Firestore.Convenience constructor for basic profile information with userId.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 Summary
Modifier and TypeMethodDescriptioncom.google.firebase.TimestampgetEmail()Returns the email address of the user.com.google.firebase.firestore.GeoPointgetPhone()getRole()com.google.firebase.TimestampbooleanisAdmin()booleanbooleanbooleanbooleanvoidsetCreatedAt(com.google.firebase.Timestamp createdAt) voidsetDeviceId(String deviceId) voidvoidsetGeolocationEnabled(boolean geolocationEnabled) voidsetInterests(List<String> interests) voidsetLocation(com.google.firebase.firestore.GeoPoint location) voidsetNotificationsEnabled(boolean notificationsEnabled) voidvoidsetProfileImageBase64(String profileImageBase64) voidvoidsetUpdatedAt(com.google.firebase.Timestamp updatedAt) voidvoidsetUsername(String username) voidtouch()Updates the updatedAt timestamp.
-
Constructor Details
-
User
public User()Default constructor required for Firestore. -
User
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
-
setUserId
-
getDeviceId
-
setDeviceId
-
getEmail
Returns the email address of the user.- Returns:
- The user's email.
-
setEmail
-
getPhone
-
setPhone
-
getUsername
-
setUsername
-
getRole
-
setRole
-
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
-
setInterests
-
getProfileImageBase64
-
setProfileImageBase64
-
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.
-