@Entity public class Event extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
Event.Category
Enum representing all the availables types of the events: music,
literature, sports, tv, cinema, internet, travel, theater
|
| Constructor and Description |
|---|
Event()
Constructor a new instance of
Event. |
Event(Integer id,
String title,
Event.Category category,
String description,
String longDescription,
Date eventDate,
String location,
int participants,
long duration,
User creator)
Constructs a new instance of
Event. |
Event(String title,
Event.Category category,
String description,
String longDescription,
Date eventDate,
String location,
long duration,
User creator)
Constructs a new instance of
Event. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCreator(User creator)
Adds a creator to an event
|
void |
addParticipant(User participant)
Adds a participant to an event and increase the participants number for
that event
|
Event.Category |
getCategory()
Returns the category of the event
|
User |
getCreator()
Returns the owner of the event
|
String |
getDescription()
Returns the description of the event.
|
long |
getDuration()
Returns the duration of the event
|
Date |
getEventDate()
Returns event date.
|
int |
getId()
Return the identifier of the event
|
String |
getLocation()
Returns the location of the event
|
String |
getLongDescription()
Returns the long description of the event
|
int |
getParticipants()
Returns the participants of the event
|
List<User> |
getParticipantsList()
Returns the list of event participants
|
String |
getTitle()
Return the event's title
|
void |
setCategory(Event.Category category)
Sets the category of the event
|
void |
setCreator(User creator)
Sets the owner of the event
|
void |
setDescription(String description)
Sets the description of the event
|
void |
setDuration(long duration)
Sets the duration of the event
|
void |
setEventDate(Date eventDate)
Sets the event date
|
void |
setId(int id) |
void |
setLocation(String location)
Sets the location of the event
|
void |
setLongDescription(String longDescription)
Sets the long description of the event
|
void |
setParticipants(int participants)
Sets the participants of the event
|
void |
setTitle(String title)
Sets the title of the event
|
public Event()
Event. This constructor is empty
because is requiredpublic Event(Integer id, String title, Event.Category category, String description, String longDescription, Date eventDate, String location, int participants, long duration, User creator)
Event. This constructor is necessary
and only used for the realization of the datasets.id - id for eventtitle - The title of the events. It must be non-null, non-empty and no
greater than 20 characters.category - The category of the event. It cannot be null.description - The description of the event. It must be non-null, non-empty
and no greater than 50 characters.longDescription - The long description of the event. It must be non-null,
non-empty and no greater than 255 characters.eventDate - The date of the eventlocation - The location of the eventparticipants - number of participants for the eventduration - The duration of the eventcreator - The owner of the eventpublic Event(String title, Event.Category category, String description, String longDescription, Date eventDate, String location, long duration, User creator)
Event. Creates a new event with an
authortitle - The title of the events. It must be non-null, non-empty and no
greater than 20 characters.category - The category of the event. It cannot be null.description - The description of the event. It must be non-null, non-empty
and no greater than 50 characters.longDescription - The long description of the event. It must be non-null,
non-empty and no greater than 255 characters.eventDate - The date of the eventlocation - The location of the eventduration - The duration of the eventcreator - The owner of the eventpublic int getId()
public void setId(int id)
public String getTitle()
public void setTitle(String title)
title - The new event's title.IllegalArgumentException - If the title is 20 characters long or less than 1 characterpublic long getDuration()
public void setDuration(long duration)
duration - The new event's duration.IllegalArgumentException - If the duration is less than 0public Event.Category getCategory()
public void setCategory(Event.Category category)
category - The new event's categorypublic String getDescription()
public void setDescription(String description)
description - The new event's descriptionIllegalArgumentException - If the description is 50 characters long or less than 1
characterpublic String getLongDescription()
public void setLongDescription(String longDescription)
longDescription - The new event's long descriptionIllegalArgumentException - If the long description is 255 characters long or less than 1
characterpublic Date getEventDate()
public void setEventDate(Date eventDate)
eventDate - The new event's datepublic String getLocation()
public void setLocation(String location)
location - The new event's locationpublic int getParticipants()
public void setParticipants(int participants)
participants - The new event's participantsIllegalArgumentException - If participants are more than 11 persons and less than 1
person.public List<User> getParticipantsList()
public User getCreator()
public void setCreator(User creator)
creator - The new owner of the eventpublic void addParticipant(User participant)
participant - The new participant in the eventNullPointerException - if null is passed as parameterpublic void addCreator(User creator)
creator - The new owner in the event.NullPointerException - if null is passed as parameterCopyright © 2016. All rights reserved.