Class Event
java.lang.Object
com.example.iconic_raffleevent.model.Event
Represents an event within the raffle system.
This includes event details such as title, description, location, date, time, and attendee lists.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLocation
(String key, Object location) Adds a location to the locations mapvoid
addRegisteredAttendees
(String registeredID) Adds an attendee to the registered list.void
addToDeclineList
(String userId) Adds a user to the declined list.void
addToInviteList
(String userId) Adds a user to the invite list.void
addWaitingListEntrant
(String entrantID) Adds an entrant to the waiting list.void
deleteLocation
(String key) Deletes a location based on a keyGets the list of users who declined the invitation.Gets the description of the event.Gets the end date of the event.Gets the end time of the event.Gets the event ID.Gets the URL of the event image.Gets the location of the event.Return the qrcode urlGets the start date of the event.Gets the start time of the event.Gets the title of the event.Gets the facility ID for an eventGets the list of users who are invited to the event.getLocation
(String key) Gets a location based on an entrant idGets a maps containing all the entrants who joined a waitlist and the locations they joined fromGets the maximum number of attendees for the event.Gets the ID of the event organizer.Returns the hashed qrcode string for an eventGets the list of registered attendees.Gets the list of waiting attendees.Gets the waiting list limit.boolean
Checks if geolocation is required for the event.boolean
Checks if the maximum attendees limit has been reached.boolean
Checks if the waiting list limit has been reached.void
removeFromDeclinedList
(String userId) Removes a user from the declined list.void
removeFromInviteList
(String userId) Removes a user from the invite list.void
setDeclinedList
(ArrayList<String> declinedList) Sets the list of users who declined the invitation.void
setEventDescription
(String eventDescription) Sets the description of the event.void
setEventEndDate
(String eventEndDate) Sets the end date of the event.void
setEventEndTime
(String eventEndTime) Sets the end time of the event.void
setEventId
(String eventId) Sets the event ID.void
setEventImageUrl
(String eventImageUrl) Sets the URL of the event image.void
setEventLocation
(String eventLocation) Sets the location of the event.void
setEventQrUrl
(String qrUrl) The Url linking to an qrcode imagevoid
setEventStartDate
(String eventStartDate) Sets the start date of the event.void
setEventStartTime
(String eventStartTime) Sets the start time of the event.void
setEventTitle
(String eventTitle) Sets the title of the event.void
setFacilityId
(String facilityId) Set the facility ID for an eventvoid
setGeolocationRequired
(boolean geolocationRequired) Sets whether geolocation is required for the event.void
setInvitedList
(ArrayList<String> invitedList) Sets the list of users invited to the event.void
setLocations
(Map<String, Object> locations) Sets a map containing entrants and their locationsvoid
setMaxAttendees
(Integer maxAttendees) Sets the maximum number of attendees for the event.void
setOrganizerID
(String organizerID) Set the organizer id for the eventvoid
Sets the event qrcodevoid
setRegisteredAttendees
(List<String> registeredAttendees) Sets the list of registered attendees.void
setWaitingList
(List<String> waitingList) Sets the waiting list of attendees.void
setWaitingListLimit
(Integer waitingListLimit) Sets the waiting list limit.
-
Constructor Details
-
Event
public Event()Constructs an empty Event object with initialized lists.
-
-
Method Details
-
getEventId
Gets the event ID.- Returns:
- the event ID as a String
-
setEventId
Sets the event ID.- Parameters:
eventId
- the event ID as a String
-
getEventTitle
Gets the title of the event.- Returns:
- the event title as a String
-
setEventTitle
Sets the title of the event.- Parameters:
eventTitle
- the event title as a String
-
getEventDescription
Gets the description of the event.- Returns:
- the event description as a String
-
setEventDescription
Sets the description of the event.- Parameters:
eventDescription
- the event description as a String
-
getEventLocation
Gets the location of the event.- Returns:
- the event location as a String
-
setEventLocation
Sets the location of the event.- Parameters:
eventLocation
- the event location as a String
-
getEventStartDate
Gets the start date of the event.- Returns:
- the event start date as a String
-
setEventStartDate
Sets the start date of the event.- Parameters:
eventStartDate
- the event start date as a String
-
getEventStartTime
Gets the start time of the event.- Returns:
- the event start time as a String
-
setEventStartTime
Sets the start time of the event.- Parameters:
eventStartTime
- the event start time as a String
-
getEventEndDate
Gets the end date of the event.- Returns:
- the event end date as a String
-
setEventEndDate
Sets the end date of the event.- Parameters:
eventEndDate
- the event end date as a String
-
getEventEndTime
Gets the end time of the event.- Returns:
- the event end time as a String
-
setEventEndTime
Sets the end time of the event.- Parameters:
eventEndTime
- the event end time as a String
-
getEventImageUrl
Gets the URL of the event image.- Returns:
- the event image URL as a String
-
setEventImageUrl
Sets the URL of the event image.- Parameters:
eventImageUrl
- the event image URL as a String
-
getMaxAttendees
Gets the maximum number of attendees for the event.- Returns:
- the max number of attendees, or Integer.MAX_VALUE if not explicitly set.
-
setMaxAttendees
Sets the maximum number of attendees for the event.- Parameters:
maxAttendees
- the maximum number of attendees. If null or negative, it defaults to Integer.MAX_VALUE.
-
isMaxAttendeesLimitReached
public boolean isMaxAttendeesLimitReached()Checks if the maximum attendees limit has been reached.- Returns:
- true if the registered attendees count is greater than or equal to the limit, or false if the limit has not been reached.
-
isGeolocationRequired
public boolean isGeolocationRequired()Checks if geolocation is required for the event.- Returns:
- true if geolocation is required, otherwise false
-
setGeolocationRequired
public void setGeolocationRequired(boolean geolocationRequired) Sets whether geolocation is required for the event.- Parameters:
geolocationRequired
- a boolean indicating geolocation requirement
-
getWaitingList
Gets the list of waiting attendees.- Returns:
- a List of Strings representing waiting attendees
-
setWaitingList
Sets the waiting list of attendees.- Parameters:
waitingList
- a List of Strings representing waiting attendees
-
getWaitingListLimit
Gets the waiting list limit.- Returns:
- the waiting list limit, or Integer.MAX_VALUE if no limit is set.
-
setWaitingListLimit
Sets the waiting list limit.- Parameters:
waitingListLimit
- the maximum number of entries allowed in the waiting list. If null or negative, it defaults to Integer.MAX_VALUE.
-
isWaitingListLimitReached
public boolean isWaitingListLimitReached()Checks if the waiting list limit has been reached.- Returns:
- true if the waiting list size is greater than or equal to the limit, or false if the limit has not been reached.
-
addWaitingListEntrant
Adds an entrant to the waiting list.- Parameters:
entrantID
- the ID of the entrant to add as a String
-
getRegisteredAttendees
Gets the list of registered attendees.- Returns:
- a List of Strings representing registered attendees
-
setRegisteredAttendees
Sets the list of registered attendees.- Parameters:
registeredAttendees
- a List of Strings representing registered attendees
-
addRegisteredAttendees
Adds an attendee to the registered list.- Parameters:
registeredID
- the ID of the attendee as a String
-
getQrCode
Returns the hashed qrcode string for an event- Returns:
- qrCode the hashed qrcode
-
setQrCode
Sets the event qrcode- Parameters:
qrCode
- the hashed qrcode of the event
-
setEventQrUrl
The Url linking to an qrcode image- Parameters:
qrUrl
- url for qrcode image
-
getEventQrUrl
Return the qrcode url- Returns:
- eventQrUrl The url of the qrcode
-
setOrganizerID
Set the organizer id for the event- Parameters:
organizerID
- The id of the user who created the event
-
getOrganizerID
Gets the ID of the event organizer.- Returns:
- Return the organizer's ID as a String.
-
getDeclinedList
Gets the list of users who declined the invitation.- Returns:
- Return the declined list as an ArrayList of Strings.
-
getInvitedList
Gets the list of users who are invited to the event.- Returns:
- Return the invited list as an ArrayList of Strings.
-
setInvitedList
Sets the list of users invited to the event.- Parameters:
invitedList
- This is the ArrayList of Strings representing the invited users.
-
setDeclinedList
Sets the list of users who declined the invitation.- Parameters:
declinedList
- This is the ArrayList of Strings representing users who declined.
-
addToInviteList
Adds a user to the invite list.- Parameters:
userId
- This is the ID of the user to add to the invited list.
-
addToDeclineList
Adds a user to the declined list.- Parameters:
userId
- This is the ID of the user to add to the declined list.
-
removeFromInviteList
Removes a user from the invite list.- Parameters:
userId
- This is the ID of the user to remove from the invited list.
-
removeFromDeclinedList
Removes a user from the declined list.- Parameters:
userId
- This is the ID of the user to remove from the declined list.
-
setFacilityId
Set the facility ID for an event- Parameters:
facilityId
- The facility ID for the event
-
getFacilityId
Gets the facility ID for an event- Returns:
- Return the facility ID for an event
-
getLocations
Gets a maps containing all the entrants who joined a waitlist and the locations they joined from- Returns:
- Map<String, Object> The map of entrants and their locations
-
setLocations
Sets a map containing entrants and their locations- Parameters:
locations
- a map holding entrant IDs as the key and their location as the value
-
addLocation
Adds a location to the locations map- Parameters:
key
- user IDlocation
- Location user joined waitlist from
-
getLocation
Gets a location based on an entrant id- Parameters:
key
- entrant id- Returns:
- Object of users location
-
deleteLocation
Deletes a location based on a key- Parameters:
key
- entrant id
-