Skip to content
Snippets Groups Projects
Commit 389dde2c authored by markman's avatar markman
Browse files

Javadoc to Model(Role, Status, TeamProjectInfo)

parent 48223dff
No related branches found
No related tags found
No related merge requests found
package Model;
/**
* Class is used to define the role of the user
*/
public class Role {
private int id;
private String name;
/**
* Class constructor (empty), used to call role without parameters needed
*/
public Role(){}
/**
* Class constructor
* @param _id User identification number
* @param _name The name of the user to be assigned the role
*/
public Role(int _id, String _name) {
this.id = _id;
this.name = _name;
}
/**
* Returns role id
* @return Value of role id
*/
public int getId() {
return id;
}
/**
* For setting role id
* @param id Role id
*/
public void setId(int id) {
this.id = id;
}
/**
* Returns name of the user role
* @return role name
*/
public String getName() {
return name;
}
/**
* Using to set name to the user role
* @param name Role name
*/
public void setName(String name) {
this.name = name;
}
......
package Model;
/**
* Enum class for determine the object status throw database. DEFAULT means the object existing
* REMOVED means the object is removed and is not available anymore
*/
public enum Status {
DEFAULT, REMOVED
}
......@@ -2,6 +2,9 @@ package Model;
import java.util.List;
/**
* Class is intended to hold info about team project as project name and summary about project bugs
*/
public class TeamProjectInfo {
private Project project;
private List<Bug> bugs;
......@@ -10,6 +13,11 @@ public class TeamProjectInfo {
private int solvedBugs;
private int totalBugs;
/**
* Constructor to build info about project bugs
* @param _project Project object about info will be built
* @param _bugs List of Bug objects to count
*/
public TeamProjectInfo(Project _project, List<Bug> _bugs) {
this.project = _project;
this.bugs = _bugs;
......@@ -19,54 +27,106 @@ public class TeamProjectInfo {
this.totalBugs = _bugs.size();
}
/**
* Returned Project object to to count info about
* @return Project object, used to get bug info
*/
public Project getProject() {
return project;
}
/**
* Used to set Project object to get info from
* @param project Project object
*/
public void setProject(Project project) {
this.project = project;
}
/**
* Used to receive selected project bugs
* @return List of Bug objects
*/
public List<Bug> getBugs() {
return bugs;
}
/**
* Used to set selected project bugs
* @param bugs List of Bug objects
*/
public void setBugs(List<Bug> bugs) {
this.bugs = bugs;
}
/**
* Used to receive selected project name
* @return Project name of selected project
*/
public String getProjectName() {
return projectName;
}
/**
* Used to set project name
* @param projectName Project name
*/
public void setProjectName(String projectName) {
this.projectName = projectName;
}
/**
* Returning amount of unsolved bugs of project
* @return Number of project bugs, that are not solved
*/
public int getUnsolvedBugs() {
return unsolvedBugs;
}
/**
* Used to set amount of project unsolved bugs
* @param unsolvedBugs Amount of unsolved bugs
*/
public void setUnsolvedBugs(int unsolvedBugs) {
this.unsolvedBugs = unsolvedBugs;
}
/**
* Used to receive amount of project solved bugs
* @return Amount of solved bugs from selected project
*/
public int getSolvedBugs() {
return solvedBugs;
}
/**
* Used to set amount of project solved bugs
* @param solvedBugs Amount of solved bugs
*/
public void setSolvedBugs(int solvedBugs) {
this.solvedBugs = solvedBugs;
}
/**
* Used to receive selected project total bugs
* @return Amount of total bugs
*/
public int getTotalBugs() {
return totalBugs;
}
/**
* Used to set amount of total bugs of selected project
* @param totalBugs Amount of project total bugs
*/
public void setTotalBugs(int totalBugs) {
this.totalBugs = totalBugs;
}
/**
* Used to count selected project all unsolved bugs
* @return Amount of project unsolved bugs
*/
public int countUnsolvedBugs() {
int count = 0;
for(Bug b: bugs) {
......@@ -76,6 +136,11 @@ public class TeamProjectInfo {
}
return count;
}
/**
* Used to count all solved bugs from selected project
* @return Amount of project solved bugs
*/
public int countSolvedBugs() {
int count = 0;
for(Bug b: bugs) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment