Added basic worker so tests can create them
This commit is contained in:
@@ -1,12 +1,22 @@
|
||||
package hhn.temp.project;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AssignmentManager {
|
||||
List<Worker> workerList;
|
||||
Map<Integer, Worker> workerMap;
|
||||
int workerIdCounter;
|
||||
|
||||
public AssignmentManager() {
|
||||
workerList = new ArrayList<>();
|
||||
workerMap = new HashMap<>();
|
||||
int workerIdCounter = 1000;
|
||||
}
|
||||
|
||||
public int createWorker(String name) {
|
||||
Worker worker = new Worker(name, ++workerIdCounter);
|
||||
workerMap.put(workerIdCounter, worker);
|
||||
return workerIdCounter;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
package hhn.temp.project;
|
||||
|
||||
public class Worker {
|
||||
String name;
|
||||
int workerId;
|
||||
public Worker(String name, int workerId) {
|
||||
this.name = name;
|
||||
this.workerId = workerId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public int getId() {
|
||||
return workerId;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user