java.lang.Object
edu.ntnu.idatt1002.k1g4.Team
The team represents a group
of competitors playing
against another team
represented by the class Match
- Version:
- 0.5
- Author:
- Callum Gran, Runar Indahl, Nicolai H. Brand, Brage H. Kvamme
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Overrides the equals method from Object Teams are the same if the names are the same.getName()
Gets the team name.int
Gets team id.boolean
Gets the is competing attributevoid
setCompeting
(boolean competing) Sets new status if the team is or is not competing.void
Sets name of the team.void
setTeamId
(int teamId) Sets team id.toString()
overrides the toString method in Object Represents a team on a one liner
-
Constructor Details
-
Team
First constructor for the team.- Parameters:
name
- String: name of the teamisCompeting
- boolean: true if the team is still eligible for matchmaking- Throws:
IllegalArgumentException
- thrown if team name is empty.
-
Team
Instantiates a new Team. This team has the isCompeting status set to true by default.- Parameters:
name
- String: The name of the team- Throws:
IllegalArgumentException
- the illegal argument exception is thrown when the name is blank.
-
Team
Instantiates a new Team. Copy constructor for Team.- Parameters:
team
- Team: the team to copy
-
Team
public Team()Instantiates a new Team. This constructor is for data from the database.
-
-
Method Details
-
getName
Gets the team name.- Returns:
- name String: the name of the team
-
isCompeting
public boolean isCompeting()Gets the is competing attribute- Returns:
- isCompeting boolean: if the team is competing or not
-
setCompeting
public void setCompeting(boolean competing) Sets new status if the team is or is not competing.- Parameters:
competing
- boolean: if the team is competing or not
-
getTeamId
public int getTeamId()Gets team id.- Returns:
- teamId int: the team id
-
setTeamId
public void setTeamId(int teamId) Sets team id.- Parameters:
teamId
- int: the team id
-
setName
Sets name of the team.- Parameters:
name
- String: the name to be set.
-
toString
overrides the toString method in Object Represents a team on a one liner -
equals
Overrides the equals method from Object Teams are the same if the names are the same.
-