@Entity public class Player extends Removed implements Serializable
| Constructor and Description |
|---|
Player(String nick,
String completeName,
byte[] image,
String interestsDescription,
List<String> favouriteSports,
List<String> favouriteTeams,
boolean visibility,
User user,
User admin)
Creates a new instance
Player |
Player(String nickName,
String interestsDescription,
String completeName)
Creates a new instance
Player |
| Modifier and Type | Method and Description |
|---|---|
void |
addTeam(Team team)
Adds a team to this player
|
boolean |
belongsToTeam(Team team)
Check if this player belongs to a team
|
User |
getAdmin()
Returns the player's admin
|
String |
getCompleteName()
Returns the complete name of the player
|
List<String> |
getFavouriteSports()
Returns the favourite sports of the player
|
List<String> |
getFavouriteTeams()
Returns the favourite teams of the player
|
int |
getId()
Returns the id of the player
|
byte[] |
getImage()
Returns the image of the player
|
String |
getInterestsDescription()
Returns the description of the interests of the player
|
String |
getNick()
Returns the nick of the player
|
User |
getPlayerUser()
Returns the user if the player has a user profile
|
List<Team> |
getTeam()
Returns the team of this user
|
void |
internalAddUser(User user)
Sets the attribute user of the player
|
boolean |
isVisibility()
Returns the visibility of the profile of the player
|
void |
removeTeam(Team team)
Removes a team from this player
|
void |
setAdmin(User admin)
Sets the admin of the player
|
void |
setCompleteName(String completeName)
Sets the complete name of the player
|
void |
setFavouriteSports(List<String> favouriteSports)
Sets the favourite sports of the player
|
void |
setFavouriteTeams(List<String> favouriteTeams)
Sets the favouriteTeams of the player
|
void |
setImage(byte[] image)
Sets the image of the player
|
void |
setInterestsDescription(String interestsDescription)
Sets the interests description of the player
|
void |
setNick(String nick)
Sets the nick of the player
|
void |
setPlayerUser(User playerUser)
Sets the user if the player has a user profile
|
void |
setVisibility(boolean visibility)
Sets the visibility of the player
|
isRemoved, setRemovedpublic Player(String nick, String completeName, byte[] image, String interestsDescription, List<String> favouriteSports, List<String> favouriteTeams, boolean visibility, User user, User admin)
Playernick - the player nick. Must be a non empty and non null string
with a maximum length of 30 chars.completeName - the complete player name. Must be a non empty and non null
string with a maximum length of 100 chars.image - the image/avatar of the player in our system.interestsDescription - description of the interests of the player. Must be a non empty
and non null string with a maximum length of 500 chars.favouriteSports - list witch contains the favourite sports of the player.favouriteTeams - list witch contains the favourite teams of the player.visibility - indicates whether the user's profile is public or private.user - type User attribute witch indicates if a player is an user of our
applicationadmin - the user who managed the playersNullPointerException - if a null value is passed as the value for some
parameters.IllegalArgumentException - if value provided for some parameters is not valid according to
its description.public Player(String nickName, String interestsDescription, String completeName)
PlayernickName - the player nick witch identifier the player in our system. Must be
a non empty and non null string with a maximum length of
30 chars.interestsDescription - description of the interests of the player. Must be a non empty
and non null string with a maximum length of 500 chars.completeName - the complete player name. 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 some
parameters.IllegalArgumentException - if value provided for some parameters is not valid according to
its description.public int getId()
public void setNick(String nick)
nick - the nick of the player which identifies the player in the system.
Must be a non empty and non null string with a maximum
length of 30 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 void setImage(byte[] image)
image - the image of the player in the system.public void setInterestsDescription(String interestsDescription)
interestsDescription - the player interests description. Must be a non empty and non
null string with a maximum length of 500 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 void setFavouriteSports(List<String> favouriteSports)
favouriteSports - the list of the favourite sports of the player.public void setFavouriteTeams(List<String> favouriteTeams)
favouriteTeams - the list of the favourite teams of the player.public void setVisibility(boolean visibility)
visibility - indicates whether the user's profile is public or private.public void setCompleteName(String completeName)
completeName - the complete name of the player. 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 getInterestsDescription()
public String getNick()
public String getCompleteName()
public byte[] getImage()
public List<String> getFavouriteSports()
public List<String> getFavouriteTeams()
public boolean isVisibility()
public void setPlayerUser(User playerUser)
playerUser - the playerUser to setpublic void internalAddUser(User user)
user - Object type User, witch represent a user who has a player profile.public void setAdmin(User admin)
admin - the admin of the player. Must be a non null User.public User getAdmin()
public User getPlayerUser()
public boolean belongsToTeam(Team team)
team - the team wich we want to know if the player belongstrue if the player belongs to this team. false
otherwisepublic void addTeam(Team team)
team - the team to add to this playerNullPointerException - if a team if nullpublic void removeTeam(Team team)
team - the team to remove from this playerNullPointerException - if a team if nullIllegalArgumentException - if the team does not belong to this teamCopyright © 2017. All rights reserved.