@Entity public class Event extends Object
| Constructor and Description |
|---|
Event()
Default constructor.
|
Event(int id,
User organizer,
User creator,
String title,
String head,
String description,
Category category,
String location,
Date start,
Date end) |
Event(int id,
User organizer,
User creator,
String title,
String head,
String description,
Category category,
String location,
Date start,
Date end,
boolean canceled) |
Event(String title,
String head,
String description,
Category category,
String location,
Date start,
Date end)
Creates a new instance of
Event |
Event(User organizer,
User creator,
String title,
String head,
String description,
Category category,
String location,
Date start,
Date end)
Creates a new instance of
Event |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttendee(User attendee)
Adds a new
User to this event's assistants set. |
int |
countAttendees()
Returns the current number of attendees of this event.
|
boolean |
equals(Object obj) |
Set<User> |
getAssistants()
Returns the list of attendees of this event.
|
Category |
getCategory()
Returns the category of the event.
|
User |
getCreator()
Returns the creator of the event.
|
String |
getDescription()
Returns the description of the event.
|
Date |
getEnd()
Returns the date end of this event.
|
String |
getHead()
Returns the head of the event.
|
int |
getId()
Returns the id of the event.
|
String |
getLocation()
Returns the location of the event.
|
User |
getOrganizer()
Returns the organizer of the event.
|
Date |
getStart()
Returns the date start of this event.
|
String |
getTitle()
Returns the title of the event.
|
int |
hashCode() |
boolean |
isAttendee(User attendee)
Checks whether a given
User is an attendee of the current event. |
boolean |
isCanceled()
Checks if the event was canceled.
|
void |
removeAttendee(User attendee)
Removes an
User from this event's assistants set. |
void |
setAssistants(User attendee)
Sets a attendees of this event.
|
void |
setCanceled(boolean isCanceled)
Changes the status of event.
|
void |
setCategory(Category category)
Sets the category of this event.
|
void |
setCreator(User creator)
Sets the creator of this event.
|
void |
setDescription(String description)
Sets the description of this event.
|
void |
setEnd(Date end)
Sets the date end of this event.
|
void |
setHead(String head)
Sets the head of the event.
|
void |
setLocation(String location)
Sets the location of this event.
|
void |
setOrganizer(User organizer)
Sets the organizer of this event.
|
void |
setStart(Date start)
Sets the date start of this event.
|
void |
setTitle(String title)
Sets the title of this event.
|
String |
toString() |
public Event()
public Event(int id,
User organizer,
User creator,
String title,
String head,
String description,
Category category,
String location,
Date start,
Date end)
public Event(int id,
User organizer,
User creator,
String title,
String head,
String description,
Category category,
String location,
Date start,
Date end,
boolean canceled)
public Event(User organizer, User creator, String title, String head, String description, Category category, String location, Date start, Date end)
Eventorganizer - the organizer of the event. This parameter must be a non
null user.creator - the creator of the event. This parameter must be a non
null user.title - the title of the event. This parameter must be a non empty and
non null string with a maximum length of 20 chars.head - the head of the event. This parameter must be a non empty and
non null string with a maximum length of 50 chars.description - the description of the event. This parameter must be a non empty and
non null string with a maximum length of 255 chars.category - the category of the event. This parameter is an enumerated of type Category
that must be a non null.location - the location of the event. This parameter must be a non empty and
non null string with a maximum length of 255 chars.start - the start date of this event. This parameter can not be
null and the date can not be before the current date.end - the end date of this event. This parameter can not be
null and the date can not be before the start date.NullPointerException - if a null value is passed as the
value for any parameter.IllegalArgumentException - if value provided for any parameter is
not valid according to its description.public Event(String title, String head, String description, Category category, String location, Date start, Date end)
Eventtitle - the title of the event. This parameter must be a non empty and
non null string with a maximum length of 20 chars.head - the head of the event. This parameter must be a non empty and
non null string with a maximum length of 50 chars.description - the description of the event. This parameter must be a non empty and
non null string with a maximum length of 255 chars.category - the category of the event. This parameter is an enumerated of type Category
that must be a non null.location - the location of the event. This parameter must be a non empty and
non null string with a maximum length of 255 chars.start - the start date of this event. This parameter can not be
null and the date can not be before the current date.end - the end date of this event. This parameter can not be
null and the date can not be before the start date.NullPointerException - if a null value is passed as the
value for any parameter.IllegalArgumentException - if value provided for any parameter is
not valid according to its description.public int getId()
public User getOrganizer()
public void setOrganizer(User organizer)
organizer - the new organizer of the event. null values not
supported.NullPointerException - if a null value is passed.public User getCreator()
public void setCreator(User creator)
creator - the new creator of the event. null values not
supported.NullPointerException - if a null value is passed.public String getTitle()
public void setTitle(String title)
title - the new title of the event. This parameter must be a non empty
and non null string with a maximum length of 20 chars.NullPointerException - if a null value is passed.IllegalArgumentException - if the length of the string passed is
not valid.public String getHead()
public void setHead(String head)
head - the new head of the event. This parameter must be a non empty
and non null string with a maximum length of 50 chars.NullPointerException - if a null value is passed.IllegalArgumentException - if the length of the string passed is
not valid.public String getDescription()
public void setDescription(String description)
description - the new description of the event. This parameter must be a non empty
and non null string with a maximum length of 255 chars.NullPointerException - if a null value is passed.IllegalArgumentException - if the length of the string passed is
not valid.public Category getCategory()
public void setCategory(Category category)
category - the new category of the event. This parameter is an enumerated of type Category
that must be a non null.NullPointerException - if a null value is passed.public String getLocation()
public void setLocation(String location)
location - the new location of the event. This parameter must be a non empty
and non null string with a maximum length of 255 chars.NullPointerException - if a null value is passed.IllegalArgumentException - if the length of the string passed is
not valid.public Date getStart()
public void setStart(Date start)
start - the new date of start for this event. This parameter can not
be null and the date can not be before the 1900 year.NullPointerException - if a null value is passed.IllegalArgumentException - if the value provided is before the
1900 year.public Date getEnd()
public void setEnd(Date end)
end - the new date of end for this event. This parameter can not
be null and the date can not be before the start date.NullPointerException - if a null value is passed.IllegalArgumentException - if the value provided is before the start date.public Set<User> getAssistants()
public void setAssistants(User attendee)
null values not
supported.attendee - a new attendee of the event. null values not
supported.NullPointerException - if a null value is passed.public int countAttendees()
public boolean isAttendee(User attendee)
User is an attendee of the current event.attendee - The user to check if it is an attendee of the event.public void addAttendee(User attendee) throws IllegalArgumentException, NullPointerException
User to this event's assistants set.attendee - The new user to add to the assistants set. It cannot be
null nor already contained in the assistants set.IllegalArgumentException - If the received user already is part of this event's
assistants set.NullPointerException - If a null attendee is received.public void removeAttendee(User attendee) throws IllegalArgumentException, NullPointerException
User from this event's assistants set.attendee - The user to remove from the assistants set. It cannot be
null, and must be contained in the assistants set.IllegalArgumentException - If the received user is not part of this event's assistants
set.NullPointerException - If a null attendee is received.public boolean isCanceled()
public void setCanceled(boolean isCanceled)
isCanceled - if the value is true the event will be canceled.Copyright © 2017. All rights reserved.