SHARE
TWEET

Untitled

a guest Feb 23rd, 2020 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.example.employeeworkshop.demo.models;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.  
  6. public class Project {
  7.     private String name;
  8.     private static int projectCount = 1;
  9.  
  10.     private List<Integer> employeeList;
  11.  
  12.     private int projectId = 0;
  13.     private final static int MIN_VALUE_OF_PROJECT_NAME = 3;
  14.     private final static int MAX_VALUE_OF_PROJECT_NAME = 15;
  15.  
  16.     public Project(){
  17.         employeeList = new ArrayList<>();
  18.         projectId = projectCount++;
  19.     }
  20.  
  21.     public Project(String name) {
  22.         setName(name);
  23.         employeeList = new ArrayList<>();
  24.         projectId = projectCount++;
  25.     }
  26.  
  27.     public String getName() {
  28.         return name;
  29.     }
  30.  
  31.     public int getProjectId() {
  32.         return projectId;
  33.     }
  34.  
  35.     public List<Integer> getEmployeeList() {
  36.         return employeeList;
  37.     }
  38.  
  39.     public void setName(String name) {
  40.         ValidationHelper.checkLength(name.length(), MIN_VALUE_OF_PROJECT_NAME, MAX_VALUE_OF_PROJECT_NAME, "project");
  41.         this.name = name;
  42.     }
  43.  
  44.     public void setProjectId(int projectId) {
  45.         this.projectId = projectId;
  46.     }
  47.  
  48.     public void setEmployeeList(int id) {
  49.         employeeList.add(id);
  50.     }
  51.  
  52.     public List<Integer> addEmployee(int id){
  53.         employeeList.add(id);
  54.         return employeeList;
  55.     }
  56. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top