Class Ticket


public class Ticket extends DatabaseObject
Tracks a user's entry into an event via a Ticket. This gathers who entered the event. when they did, and where they did all in one object.
  • Constructor Details

    • Ticket

      public Ticket()
      No arg constructor for a Ticket. Required by Firebase.
    • Ticket

      public Ticket(@NonNull PersonalInformation userPersonalInfo, @NonNull String userId, @NonNull String eventId, @Nullable CustomLocation location)
      Constructor for a Ticket.
      Parameters:
      userId - The id of the user that this ticket is associated with
      location - The location that the user is casting the ticket from, or NULL if not given.
    • Ticket

      public Ticket(@NonNull PersonalInformation userPersonalInfo, @NonNull String userId, @NonNull String eventId)
      Constructor for a Ticket without location.
      Parameters:
      userId - The id of the user that this ticket is associated with
      eventId - The id of the event that this ticket is associated with
  • Method Details

    • getUserPersonalInfo

      public PersonalInformation getUserPersonalInfo()
      Gets the personal information of the user that joined the event
      Returns:
      The personal information of the user.
    • getUserId

      @NonNull public String getUserId()
      Gets the user id who entered the event.
      Returns:
      The user id which entered the event
    • setUserId

      public void setUserId(String userId)
      Sets the user id who entered the event.
      Parameters:
      userId - The new id of the user that this ticket is associated with
    • getEventId

      public String getEventId()
      Gets the event id that this ticket is associated with.
      Returns:
      The event id that this ticket is associated with.
    • setEventId

      public void setEventId(String eventId)
      Sets the event id that this ticket is associated with.
      Parameters:
      eventId - The new event id that this ticket is associated with.
    • getTicketTime

      public long getTicketTime()
      Gets the time the user entered the event.
      Returns:
      The time the user entered the event as a unix epoch
    • setTicketTime

      public void setTicketTime(long ticketTime)
      Sets the time the user entered the event.
      Parameters:
      ticketTime - The time the user entered the event as a unix epoch
    • getLocation

      @Nullable public CustomLocation getLocation()
      Gets the location the user entered the event.
      Returns:
      The location the user entered the event or NULL if not stored.
    • setLocation

      public void setLocation(@Nullable CustomLocation location)
      Sets the location the user entered the event.
      Parameters:
      location - The location the user entered the event
    • getStatus

      public TicketStatus getStatus()
      Gets the status of the ticket.
      Returns:
      The status of the ticket
    • setStatus

      public void setStatus(TicketStatus status)
      Sets the status of the ticket.
      Parameters:
      status - The status of the ticket