| Modifier and Type | Class and Description |
|---|---|
static class |
Event.Category
Enum representing all the available event categories: Books, Internet,
Movies, Music, Sports, Television, Theatre and Travels.
|
| Constructor and Description |
|---|
Event(Event.Category category,
String title,
String summary,
LocalDateTime date,
String location,
String description)
Constructs a new instance of
Event. |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttendee(User attendee)
Adds a new
User to this event's attendees set. |
int |
countAttendees()
Returns the current number of attendees of this event.
|
boolean |
equals(Object that) |
Set<User> |
getAttendees()
|
Event.Category |
getCategory()
Returns the
Event.Category of the event. |
LocalDateTime |
getDate()
Returns the event's date as a
LocalDateTime. |
String |
getDescription()
Retrieves the long description of a event
|
int |
getId()
Returns the identifier of the event.
|
String |
getLocation()
Returns the event's location as a
String. |
User |
getOwner()
Returns the event's owner as an
User. |
String |
getSummary()
Returns the event's summary as a
String. |
String |
getTitle()
Returns the event's title as a
String. |
boolean |
hasAttendee(User attendee)
Checks whether a given
User is an attendee of the current event. |
int |
hashCode() |
boolean |
isCancelled()
Returns if the event is cancelled
|
void |
removeAttendee(User attendee)
Removes an
User from this event's attendees set. |
void |
setCancelled(boolean cancelled)
Changes if the event is cancelled
|
void |
setCategory(Event.Category category)
Changes the
Event.Category of the event. |
void |
setDate(LocalDateTime date)
Changes the date of the event.
|
void |
setDescription(String description)
Changes if the event long description is modified
|
void |
setLocation(String location)
Changes the location of the event.
|
void |
setOwner(User owner)
Changes the owner of the event.
|
void |
setSummary(String summary)
Changes the summary of the event.
|
void |
setTitle(String title)
Changes the title of the event.
|
String |
toString() |
public Event(Event.Category category, String title, String summary, LocalDateTime date, String location, String description) throws IllegalArgumentException, NullPointerException
Event.category - The Event.Category of the event. It cannot be null.title - A String with the title of the event. It must be
non-null, non-empty and no greater than 20 characters.summary - A String with the summary of the event. It must
be non-null, non-empty and no greater than 50 characters.date - The LocalDateTime of the event. It cannot be null.location - A String with the location of the event. It must
be non-null, non-empty and no greater than 20 characters.IllegalArgumentException - If any of the Event's
field requirements does not hold.NullPointerException - If any of the given arguments is
null.public int getId()
public Event.Category getCategory()
Event.Category of the event.public void setCategory(Event.Category category) throws NullPointerException
Event.Category of the event.category - The new event's category. It cannot be null.NullPointerException - If a null category is received.public String getTitle()
String.public void setTitle(String title) throws IllegalArgumentException, NullPointerException
title - The new event's title as a String. It cannot be
null, empty nor greater than 20 characters.IllegalArgumentException - If the title is empty or its length
exceeds the limit of 20 characters.NullPointerException - If a null title is received.public String getSummary()
String.public void setSummary(String summary) throws IllegalArgumentException, NullPointerException
summary - The new event's summary as a String. It cannot be
null, empty nor greater than 50 characters.IllegalArgumentException - If the summary is empty or its length
exceeds the limit of 50 characters.NullPointerException - If a null summary is received.public LocalDateTime getDate()
LocalDateTime.public void setDate(LocalDateTime date) throws NullPointerException
date - The new event's date as a LocalDateTime. It cannot be
null.NullPointerException - If a null date is received.public String getLocation()
String.public void setLocation(String location) throws IllegalArgumentException, NullPointerException
location - The new event's location as a String. It cannot
be null, empty nor greater than 20 characters.IllegalArgumentException - If the location is empty or its length
exceeds the limit of 20 characters.NullPointerException - If a null location is received.public User getOwner()
User.public void setOwner(User owner) throws NullPointerException
owner - The new event's owner as an User. It cannot be
null.NullPointerException - If a null owner is received.public boolean isCancelled()
true if the event is cancelled, false otherwisepublic void setCancelled(boolean cancelled)
cancelled - global variablepublic String getDescription()
public void setDescription(String description)
description - global variablepublic int countAttendees()
public boolean hasAttendee(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 attendees set.attendee - The new user to add to the attendees set. It cannot be
null nor already contained in the attendees set.IllegalArgumentException - If the received user already is part of
this event's attendees set.NullPointerException - If a null attendee is received.public void removeAttendee(User attendee) throws IllegalArgumentException, NullPointerException
User from this event's attendees set.attendee - The user to remove from the attendees set. It cannot be
null, and must be contained in the attendees set.IllegalArgumentException - If the received user is not part of this
event's attendees set.NullPointerException - If a null attendee is received.Copyright © 2015. All rights reserved.