Class MoodEvent

java.lang.Object
com.kernelcrew.moodapp.data.MoodEvent
All Implemented Interfaces:
Serializable

public class MoodEvent extends Object implements Serializable
A logged mood event owned by a user referenced by that user's firebase auth UID.
See Also:
  • 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

      public String getId()
    • setId

      public void setId(String id)
    • getUid

      public String getUid()
    • setUid

      public void setUid(String uid)
    • getUsername

      public String getUsername()
    • setUsername

      public void setUsername(String username)
    • getCreated

      public Date getCreated()
    • setCreated

      public void setCreated(Date created)
    • getEmotion

      public Emotion getEmotion()
    • setEmotion

      public void setEmotion(String emotionValue)
    • getSocialSituation

      public String getSocialSituation()
    • setSocialSituation

      public void setSocialSituation(String socialSituation)
    • getReason

      public String getReason()
    • setReason

      public void setReason(String reason)
    • getPhoto

      public Bitmap getPhoto()
    • setPhoto

      public void setPhoto(Bitmap photo)
    • getPhotoBytes

      @Nullable public List<Integer> 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

      public void setPhotoBytes(@Nullable List<Integer> byteList)
      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

      public Double getLatitude()
    • setLatitude

      public void setLatitude(Double latitude)
    • getLongitude

      public Double getLongitude()
    • setLongitude

      public void setLongitude(Double longitude)
    • hasLocation

      public boolean hasLocation()
    • getTimestamp

      public long getTimestamp()
    • getVisibility

      @NonNull public MoodEventVisibility getVisibility()
    • setVisibility

      public void setVisibility(MoodEventVisibility visibility)
      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)