@Entity(name="Headquarter") public class Headquarter extends Removed implements Serializable
| Constructor and Description |
|---|
Headquarter(String name,
String description,
String address,
String locality,
String province,
User admin)
Creates a new instance of
Headquarter. |
Headquarter(String name,
String description,
String address,
String locality,
String province,
User admin,
Team... teams)
Creates a new instance of
Headquarter. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCompetition(Competition competition)
Adds a competition from this headquarters
|
void |
addTeam(Team team)
Adds a team to this headquarters
|
String |
getAddress()
Returns the address of the headquarter.
|
User |
getAdmin()
Returns the administrator of the headquarter.
|
Collection<Competition> |
getCompetitions()
Returns the competitions that belongs to this headquarters.
|
String |
getDescription()
Returns the description of the headquarter.
|
String |
getLocality()
Returns the locality of the headquarter.
|
String |
getName()
Returns the name of the headquarter.
|
String |
getProvince()
Returns the province of the headquarter.
|
Collection<Team> |
getTeams()
Returns the teams that belongs to this headquarters.
|
boolean |
ownsTeam(Team team)
Checks if a team belongs to this headquarters
|
void |
removeCompetition(Competition competition)
Removes a competition from this headquarters and removes this headquarters
from the competition.
|
void |
removeTeam(Team team)
Removes a team from this headquarters
|
void |
setAddress(String address)
Sets the address of this headquarter.
|
void |
setAdmin(User admin)
Sets the administrator of this headquarter.
|
void |
setCompetitions(ArrayList<Competition> competitions)
Adds a list of competitions to the headquarters
|
void |
setDescription(String description)
Sets the description of this headquarter.
|
void |
setLocality(String locality)
Sets the locality of this headquarter.
|
void |
setName(String name)
Sets the name of this headquarter.
|
void |
setProvince(String province)
Sets the province of this headquarter.
|
isRemoved, setRemovedpublic Headquarter(String name, String description, String address, String locality, String province, User admin)
Headquarter.name - the name of the headquarter. This parameter must be a non empty
and non null string with a maximum length of 100 chars.description - the description of the headquarter. This parameter can not be
null. String with a maximum length of 250 chars.address - the address of this headquarter. This parameter can not be
null. String with a maximum length of 100 chars.locality - the locality of this headquarter. This parameter can not be
null. String with a maximum length of 100 chars.province - the province of this headquarter. This parameter can not be
null. String with a maximum length of 100 chars.admin - the administrator of this headquarter. A user class.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 Headquarter(String name, String description, String address, String locality, String province, User admin, Team... teams)
Headquarter.name - the name of the headquarter. This parameter must be a non empty
and non null string with a maximum length of 100 chars.description - the description of the headquarter. This parameter can not be
null. String with a maximum length of 250 chars.address - the address of this headquarter. This parameter can not be
null. String with a maximum length of 100 chars.locality - the locality of this headquarter. This parameter can not be
null. String with a maximum length of 100 chars.province - the province of this headquarter. This parameter can not be
null. String with a maximum length of 100 chars.admin - the administrator of this headquarter. A user class.teams - the teams to belongs this headquarterspublic String getName()
public void setName(String name)
name - the new name of this headquarter. This parameter can not be
null and can not be longer than 100 chars.NullPointerException - if a null value is passed.IllegalArgumentException - if the value provided is longer than 100 chars.public String getDescription()
public void setDescription(String description)
description - is the new description for this headquarter. This parameter can
not be null and can not be longer than 250 chars.NullPointerException - if a null value is passed.IllegalArgumentException - if the value provided is longer than 250 chars.public String getAddress()
public void setAddress(String address)
address - is the new address for this headquarter. This parameter can not be
null and can not be longer than 100 chars.NullPointerException - if a null value is passed.IllegalArgumentException - if the value provided is longer than 100 chars.public String getLocality()
public void setLocality(String locality)
locality - is the new locality for this headquarter. This parameter can not
be null and can not be longer than 100 chars.NullPointerException - if a null value is passed.IllegalArgumentException - if the value provided is longer than 100 chars.public String getProvince()
public void setProvince(String province)
province - is the new province for this headquarter. This parameter can not
be null and can not be longer than 100 chars.NullPointerException - if a null value is passed.IllegalArgumentException - if the value provided is longer than 100 chars.public User getAdmin()
public void setAdmin(User admin)
admin - is the new administrator for this headquarter. This parameter can
not be null.NullPointerException - if a null value is passed.IllegalArgumentException - if the value provided is not a User.public Collection<Team> getTeams()
public void addTeam(Team team)
team - the team to add to this headquartersNullPointerException - if a team is null.public void removeTeam(Team team)
team - the team to remove to this headquartersNullPointerException - if a team is null.IllegalArgumentException - if the team does not belong to this headquarterspublic boolean ownsTeam(Team team)
team - the team whose property will be checkedtrue if the team belongs to this headquarters. false
otherwisepublic void addCompetition(Competition competition)
competition - the competition to add to this headquartersNullPointerException - if a null value is passed.public void removeCompetition(Competition competition)
competition - the competition to remove to this headquartersNullPointerException - if a competition is null.IllegalArgumentException - if the competition does not belong to this headquarterspublic Collection<Competition> getCompetitions()
public void setCompetitions(ArrayList<Competition> competitions)
competitions - the list to add to the headquartersCopyright © 2017. All rights reserved.