Package com.kernelcrew.moodapp.data
Class MoodEvent
java.lang.Object
com.kernelcrew.moodapp.data.MoodEvent
- All Implemented Interfaces:
Serializable
A logged mood event owned by a user referenced by that user's firebase auth UID.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()
getPhoto()
PNG encode the photo as a list of bytes (each an int so that it is serializable by Firestore.)long
getUid()
boolean
boolean
isSynced()
void
setCreated
(Date created) void
setEmotion
(String emotionValue) void
void
setLatitude
(Double latitude) void
setLongitude
(Double longitude) void
void
setPhotoBytes
(List<Integer> byteList) Set the photo associated with this mood event.void
void
setSocialSituation
(String socialSituation) void
setSynced
(boolean synced) void
void
setUsername
(String username) void
setVisibility
(MoodEventVisibility visibility) Update the visibility.
-
Constructor Details
-
MoodEvent
public MoodEvent()Empty constructor for Firestore deserialization. Do not use. -
MoodEvent
public MoodEvent(String uid, String username, Emotion emotion, String socialSituation, String reason, Double latitude, Double longitude) Constructor for a new MoodEvent with additional details. Will assign this mood event a new random id.
-
-
Method Details
-
getId
-
setId
-
getUid
-
setUid
-
getUsername
-
setUsername
-
getCreated
-
setCreated
-
getEmotion
-
setEmotion
-
getSocialSituation
-
setSocialSituation
-
getReason
-
setReason
-
getPhoto
-
setPhoto
-
getPhotoBytes
PNG encode the photo as a list of bytes (each an int so that it is serializable by Firestore.)- Returns:
- PNG encoded photo or null
-
setPhotoBytes
Set the photo associated with this mood event. The photo bytes must be PNG encoded as a list of bytes (store as integers in Firestore).- Parameters:
byteList
- List of bytes encoding the PNG photo
-
getLatitude
-
setLatitude
-
getLongitude
-
setLongitude
-
hasLocation
public boolean hasLocation() -
getTimestamp
public long getTimestamp() -
getVisibility
-
setVisibility
Update the visibility. Cannot change visibility to null.- Parameters:
visibility
- New visibility. If null, no change is made.
-
isSynced
public boolean isSynced() -
setSynced
public void setSynced(boolean synced)
-