@Entity public class User extends Object implements Serializable
| Constructor and Description |
|---|
User(String email,
String name,
String surname,
GregorianCalendar birthdate,
IdentificationType identificationType,
String numIdentificationType,
String residence,
String location,
String province,
String country,
String phone)
Creates a new instance
User |
User(String email,
String name,
String surname,
GregorianCalendar birthdate,
IdentificationType identificationType,
String numIdentificationType,
String residence,
String location,
String province,
String country,
String phone,
HashMap<String,String> socialNetworks,
Player player,
ArrayList<Player> managedPlayers,
ArrayList<Competition> managedCompetitions,
Team... teams)
Creates a new instance
User |
| Modifier and Type | Method and Description |
|---|---|
void |
addCompetition(Competition competition)
Creates the relation between the user and the competition.
|
void |
addPlayer(Player player)
Creates the relation between the user and the player.
|
void |
addTeam(Team team)
Adds a team to this user
|
GregorianCalendar |
getBirthdate()
Returns the birthdate of the user
|
String |
getCountry()
Returns the country of the user
|
String |
getEmail()
Returns the email of the user
|
IdentificationType |
getIdentificationType()
Returns the identificationType of the user
|
String |
getLocation()
Returns the location of the user
|
ArrayList<Competition> |
getManagedCompetitions()
Returns the competitions managed by the user
|
ArrayList<Player> |
getManagedPlayers()
Returns the players managed by the user
|
String |
getName()
Returns the name of the user
|
String |
getNumIdentificationType()
Returns the user identification number
|
String |
getPhone()
Returns the phone of the user
|
Player |
getPlayerUser() |
String |
getProvince()
Returns the province of the user
|
String |
getResidence()
Returns the residence of the user
|
HashMap<String,String> |
getSocialNetworks()
Returns the social networks of the user
|
String |
getSurname()
Returns the surname of the user
|
Collection<Team> |
getTeams()
Returns the user that belongs to this user.
|
boolean |
hasOwner(Team team)
Checks if the team already has an owner
|
void |
internalAddCompetition(Competition competition)
Adds a competition directly to the competition list of this user if the
competition does not already managed by this user.
|
void |
internalAddPlayer(Player player)
Sets the atribute player of the user
|
void |
internalAddPlayerList(Player player)
Adds a player directly to the player list of this user if the player does not
already managed by this user.
|
void |
internalAddTeam(Team team)
Adds a team directly to the teams collection of this user if the team does
not already belongs to this user
|
void |
internalRemoveCompetition(Competition competition)
Removes a competition directly from the competitions list of this user.
|
void |
internalRemovePlayerList(Player player)
Removes a player directly from the players list of this user.
|
void |
internalRemoveTeam(Team team)
Removes a team directly to this teams collection of this user if the team
does not already belongs to this headquarters
|
boolean |
managesCompetition(Competition competition)
Checks if a competition is managed by the user.
|
boolean |
managesPlayers(Player player)
Checks if a player is managed by the user.
|
boolean |
ownsTeam(Team team)
Checks if a team belongs to this user
|
void |
removeCompetition(Competition competition)
Deletes the relation between the user and the competition.
|
void |
removePlayer(Player player)
Deletes the relation between the user and the player.
|
void |
removeTeam(Team team)
Removes a team from this user
|
void |
setBirthdate(GregorianCalendar birthdate)
Sets the birthdate of the user
|
void |
setCountry(String country)
Sets the country of the user
|
void |
setEmail(String email)
Sets the email of the user
|
void |
setIdentificationType(IdentificationType identificationType)
Sets the identification type of the user
|
void |
setLocation(String location)
Sets the location of the user
|
void |
setManagedCompetitions(ArrayList<Competition> managedCompetitions)
Sets the competitions managed by the user
|
void |
setManagedPlayers(ArrayList<Player> managedPlayers)
Sets the players managed by the user
|
void |
setName(String name)
Sets the name of the user
|
void |
setNumIdentificationType(String numIdentificationType)
Sets the user identification number
|
void |
setPhone(String phone)
Sets the phone of the user
|
void |
setPlayerUser(Player userPlayer) |
void |
setProvince(String province)
Sets the province of the user
|
void |
setResidence(String residence)
Sets the residence of the user
|
void |
setSocialNetworks(HashMap<String,String> socialNetworks)
Sets the social networks of the user
|
void |
setSurname(String surname)
Sets the name of the user
|
public User(String email, String name, String surname, GregorianCalendar birthdate, IdentificationType identificationType, String numIdentificationType, String residence, String location, String province, String country, String phone, HashMap<String,String> socialNetworks, Player player, ArrayList<Player> managedPlayers, ArrayList<Competition> managedCompetitions, Team... teams)
Useremail - the email of the user which identifies the user in the system.
Must be a non empty and non null string with a maximum
length of 100 chars.name - the name of the user. Must be a non empty and non null
string with a maximum length of 100 chars.surname - the surname of the user. Must be a non empty and non null
string with a maximum length of 200 chars.birthdate - the birthdate of the user. Must be a non empty and non
null string.identificationType - the enumerated data with all the possibles choices of the system
in identification type of user. Must be a non empty and non
null string.numIdentificationType - the user identification number in the format of the
identificationType. Must be a non empty and non null
string with a maximum length of 50 chars.residence - the residence of the user. Must be a non empty and non
null string with a maximum length of 200 chars.location - the location of the user. Must be a non empty and non null
string with a maximum length of 100 chars.province - the province of the user. Must be a non empty and non null
string with a maximum length of 100 chars.country - the country of the user. Must be a non empty and non null
string with a maximum length of 100 chars.phone - the phone of the user. Must be a non empty and non null
string with a maximum length of 25 chars.socialNetworks - the map of the social networks of the user, with the value of the
social network as a key and the profile in that social network as
a value.player - the player atribute of the user witch represent a player who has
an user account.managedPlayers - the player list managed by the user.managedCompetitions - the competitions managed by the user.Must be a non empty and non
null list of competitions.teams - the teams managed by the user.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 User(String email, String name, String surname, GregorianCalendar birthdate, IdentificationType identificationType, String numIdentificationType, String residence, String location, String province, String country, String phone)
Useremail - the email of the user which identifies the user in the system.
Must be a non empty and non null string with a maximum
length of 100 chars.name - the name of the user. Must be a non empty and non null
string with a maximum length of 100 chars.surname - the surname of the user. Must be a non empty and non null
string with a maximum length of 200 chars.birthdate - the birthdate of the user. Must be a non empty and non
null string.identificationType - the enumerated data with all the possibles choices of the system
in identification type of user. Must be a non empty and non
null string.numIdentificationType - the user identification number in the format of the
identificationType. Must be a non empty and non null
string with a maximum length of 50 chars.residence - the residence of the user. Must be a non empty and non
null string with a maximum length of 200 chars.location - the location of the user. Must be a non empty and non null
string with a maximum length of 100 chars.province - the province of the user. Must be a non empty and non null
string with a maximum length of 100 chars.country - the country of the user. Must be a non empty and non null
string with a maximum length of 100 chars.phone - the phone of the user. Must be a non empty and non null
string with a maximum length of 25 chars.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 String getEmail()
public void setEmail(String email)
email - the email of the user which identifies the user in the system.
Must be a non empty and non null string with a maximum
length of 100 chars.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 String getName()
public void setName(String name)
name - the name of the user. Must be a non empty and non null
string with a maximum length of 100 chars.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 String getSurname()
public void setSurname(String surname)
surname - the surname of the user. Must be a non empty and non null
string with a maximum length of 200 chars.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 GregorianCalendar getBirthdate()
public void setBirthdate(GregorianCalendar birthdate)
birthdate - the birthdate of the user. Must be a non empty and non
null string.NullPointerException - if a null value is passed as the value for any parameter.public IdentificationType getIdentificationType()
public void setIdentificationType(IdentificationType identificationType)
identificationType - the enumerated data with all the possibles choices of the system
in identification type of user. Must be a non empty and non
null string.NullPointerException - if a null value is passed as the value for any
parameter..public String getNumIdentificationType()
public void setNumIdentificationType(String numIdentificationType)
numIdentificationType - the user identification number in the format of the
identificationType. Must be a non empty and non null
string with a maximum length of 50 chars.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 String getResidence()
public void setResidence(String residence)
residence - the residence of the user. Must be a non empty and non
null string with a maximum length of 200 chars.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 String getLocation()
public void setLocation(String location)
location - the location of the user. Must be a non empty and non null
string with a maximum length of 100 chars.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 String getProvince()
public void setProvince(String province)
province - the province of the user. Must be a non empty and non null
string with a maximum length of 100 chars.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 String getCountry()
public void setCountry(String country)
country - the country of the user. Must be a non empty and non null
string with a maximum length of 100 chars.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 String getPhone()
public void setPhone(String phone)
phone - the phone of the user. Must be a non empty and non null
string with a maximum length of 25 chars.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 HashMap<String,String> getSocialNetworks()
public void setSocialNetworks(HashMap<String,String> socialNetworks)
socialNetworks - the map of the social networks of the user, with the value of the
social network as a key and the profile in that social network as
a value.public Player getPlayerUser()
public void setPlayerUser(Player userPlayer)
userPlayer - the userPlayer to setpublic void internalAddPlayer(Player player)
player - Object type Player, witch represent a player who has an user
account.public Collection<Team> getTeams()
public boolean ownsTeam(Team team)
team - the team whose property will be checkedtrue if the team belongs to this user. false
otherwisepublic boolean hasOwner(Team team)
team - the team whose property will be checkedtrue if the team does not have a manager. false
otherwisepublic void addTeam(Team team)
team - the user to add to this userNullPointerException - if a team is null.public void removeTeam(Team team)
team - the user to remove to this userNullPointerException - if a team is null.public void internalRemoveTeam(Team team)
team - the the to remove to this userNullPointerException - if a team is null.public void internalAddTeam(Team team)
team - the team to add to this userNullPointerException - if a team is null.public ArrayList<Competition> getManagedCompetitions()
public void setManagedCompetitions(ArrayList<Competition> managedCompetitions)
managedCompetitions - the managedCompetitions to setpublic boolean managesCompetition(Competition competition)
competition - the competition whose property will be checked.true if the competition is managed by the user. false
otherwise.public void internalRemoveCompetition(Competition competition)
competition - the competition to remove from this user. null values not
supported.NullPointerException - if the competition is null.public void internalAddCompetition(Competition competition)
competition - the competition to add to this user. null values not
supported.NullPointerException - if the competition is null.public void addCompetition(Competition competition)
competition - the competition to add to this user. null values not
supported.NullPointerException - if the competition is null.public void removeCompetition(Competition competition)
competition - the competition to add to this user. null values not
supported.NullPointerException - if the competition is null.public ArrayList<Player> getManagedPlayers()
public void setManagedPlayers(ArrayList<Player> managedPlayers)
managedPlayers - the managedPlayers to setpublic boolean managesPlayers(Player player)
player - the player whose property will be checked.true if the player is managed by the user. false
otherwise.public void internalRemovePlayerList(Player player)
player - the player to remove from this user. null values not
supported.NullPointerException - if the player is null.public void internalAddPlayerList(Player player)
player - the player to add to this user. null values not supported.NullPointerException - if the player is null.public void addPlayer(Player player)
player - the player to add to this user. null values not supported.NullPointerException - if the player is null.public void removePlayer(Player player)
player - the player to add to this user. null values not supported.NullPointerException - if the player is null.Copyright © 2017. All rights reserved.