Package com.example.skeddly.business
Class Ticket
java.lang.Object
com.example.skeddly.business.database.DatabaseObject
com.example.skeddly.business.Ticket
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 Summary
ConstructorsConstructorDescriptionTicket()No arg constructor for a Ticket.Ticket(PersonalInformation userPersonalInfo, String userId, String eventId) Constructor for a Ticket without location.Ticket(PersonalInformation userPersonalInfo, String userId, String eventId, CustomLocation location) Constructor for a Ticket. -
Method Summary
Modifier and TypeMethodDescriptionGets the event id that this ticket is associated with.Gets the location the user entered the event.Gets the status of the ticket.longGets the time the user entered the event.Gets the user id who entered the event.Gets the personal information of the user that joined the eventvoidsetEventId(String eventId) Sets the event id that this ticket is associated with.voidsetLocation(CustomLocation location) Sets the location the user entered the event.voidsetStatus(TicketStatus status) Sets the status of the ticket.voidsetTicketTime(long ticketTime) Sets the time the user entered the event.voidSets the user id who entered the event.Methods inherited from class com.example.skeddly.business.database.DatabaseObject
fetchDatabaseObjectRelatedMethods, getId, setId
-
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 withlocation- 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 witheventId- The id of the event that this ticket is associated with
-
-
Method Details
-
getUserPersonalInfo
Gets the personal information of the user that joined the event- Returns:
- The personal information of the user.
-
getUserId
Gets the user id who entered the event.- Returns:
- The user id which entered the event
-
setUserId
Sets the user id who entered the event.- Parameters:
userId- The new id of the user that this ticket is associated with
-
getEventId
Gets the event id that this ticket is associated with.- Returns:
- The event id that this ticket is associated with.
-
setEventId
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
Gets the location the user entered the event.- Returns:
- The location the user entered the event or NULL if not stored.
-
setLocation
Sets the location the user entered the event.- Parameters:
location- The location the user entered the event
-
getStatus
Gets the status of the ticket.- Returns:
- The status of the ticket
-
setStatus
Sets the status of the ticket.- Parameters:
status- The status of the ticket
-