Class Event


public class Event extends DatabaseObject
This class represents an event.
  • Constructor Details

    • Event

      public Event()
      No arg Constructor for an Event. Required by Firestore.
    • Event

      public Event(EventDetail eventDetails, EventSchedule eventSchedule, com.google.android.gms.maps.model.LatLng location, String organizer, int waitingListLimit, int participantListLimit, boolean logLocation, byte[] image)
      Constructor for the Event
      Parameters:
      eventDetails - The details of the event
      eventSchedule - The schedule of the event
      location - The location of the event
      organizer - The ID of the organizer of the event
      waitingListLimit - The limit of the waiting list
      participantListLimit - The limit of the participant list
      logLocation - Whether your location is required to be logged when joining the waiting list.
      image - The image of the event as base64
    • Event

      public Event(EventDetail eventDetails, EventSchedule eventSchedule, com.google.android.gms.maps.model.LatLng location, String organizer, int participantListLimit, boolean logLocation, byte[] image)
      Constructor for the Event without bounds on waiting list
      Parameters:
      eventDetails - The details of the event
      eventSchedule - The schedule of the event
      location - The location of the event
      organizer - The organizer of the event
      participantListLimit - The limit of the participant list
      logLocation - Whether your location is required to be logged when joining the waiting list.
      image - The image of the event as base64
  • Method Details

    • getEventDetails

      public EventDetail getEventDetails()
      Gets details of the events
      Returns:
      The details of the events
    • setEventDetails

      public void setEventDetails(EventDetail eventDetails)
      Sets the details of the events
      Parameters:
      eventDetails - The details of the events
    • getEventSchedule

      public EventSchedule getEventSchedule()
      Gets the schedule of the event
      Returns:
      The schedule of the event
    • setEventSchedule

      public void setEventSchedule(EventSchedule eventSchedule)
      Sets the schedule of the event
      Parameters:
      eventSchedule - The schedule of the event
    • getLocation

      public CustomLocation getLocation()
      Gets the location of the event
      Returns:
      The location of the event
    • setLocation

      public void setLocation(CustomLocation location)
      Sets the location of the event
      Parameters:
      location - The location of the event
    • getOrganizer

      public String getOrganizer()
      Gets the organizer id of the event
      Returns:
      The organizer id of the event
    • setOrganizer

      public void setOrganizer(String organizer)
      Sets the organizer of the event by their ID
      Parameters:
      organizer - The organizer id to set it to
    • getWaitingList

      public WaitingList getWaitingList()
      Gets the waiting list of the event
      Returns:
      The waiting list of the event
    • setWaitingList

      public void setWaitingList(WaitingList waitingList)
      Sets the waiting list of the event
      Parameters:
      waitingList - The waiting list of the event
    • getParticipantList

      public ParticipantList getParticipantList()
      Gets the participant list of the event
      Returns:
      The participant list of the event
    • setParticipantList

      public void setParticipantList(ParticipantList participantList)
      Sets the participant list of the event
      Parameters:
      participantList - The participant list of the event
    • getLogLocation

      public boolean getLogLocation()
      Gets whether location logging is required to join the waiting list
      Returns:
      True if it is required. False otherwise.
    • setLogLocation

      public void setLogLocation(boolean logLocation)
      Sets the location logging requirement for the event.
      Parameters:
      logLocation - The new boolean value for the requirement.
    • getImageb64

      public String getImageb64()
      Gets the image of the event as a base64 string
      Returns:
      The image of the event as base64
    • setImageb64

      public void setImageb64(String imageb64)
      Sets the image of the event
      Parameters:
      imageb64 - The image of the event as base64
    • isJoinable

      public boolean isJoinable()
      Queries whether the event is joinable or not. An event is joinable if the waiting list is not full and the registration period has not ended yet.
      Returns:
      True if the event can be joined. False otherwise.
    • draw

      public void draw(int numToDraw)
      Draws a number of participants into the Participant List.
      Parameters:
      numToDraw - The number of participants to draw.
    • join

      public void join(DatabaseHandler dbHandler, PersonalInformation userPersonalInfo, String userId, CustomLocation location)
      Handles the logic for a user joining the event's waitlist.
      Parameters:
      dbHandler - The database handler to interact with Firebase.
      userId - The ID of the user who is joining.
    • leave

      public void leave(DatabaseHandler dbHandler, String ticketId)
      Handles the logic for a user leaving the event's waitlist.
      Parameters:
      dbHandler - The database handler to interact with Firebase.
      ticketId - The ID of the ticket to be removed.
    • clearImage

      public void clearImage(DatabaseHandler dbHandler)
    • findUserTicketId

      public void findUserTicketId(String userId, DatabaseHandler dbHandler, Event.FindTicketCallback callback)
      Finds the ticket ID of a user in the event's waiting list.
      Parameters:
      userId - The ID of the user to search for.
      dbHandler - The database handler to interact with Firebase.
      callback - The callback to be invoked when the search is complete.