Skip to content
Snippets Groups Projects
Commit 444ce965 authored by Rafi's avatar Rafi
Browse files

Implemented Employee class to make it easier to get employee data, handle...

Implemented Employee class to make it easier to get employee data, handle changes to database, and for testing.
parent 540ff77a
No related branches found
No related tags found
1 merge request!6Changed update implementation for employees so rather than sending the whole...
package com.example.schedulerapp;
import java.util.Map;
public class Employee {
private int employeeID;
private boolean isManager;
private String firstName;
private String lastName;
private String email;
private String phoneNumber;
private float wage;
private String[] positions;
private Map<String, Shift> Availability;
public Employee(String employeeData){
try {
String[] dataSplit = employeeData.split("\\.");
this.employeeID = Integer.parseInt(dataSplit[0]);
this.firstName = dataSplit[1];
this.lastName = dataSplit[2];
} catch (Exception exception) {
exception.printStackTrace();
}
}
public int getEmployeeID() {
return employeeID;
}
public String getFullName() {
return firstName + " " + lastName;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public float getWage() {
return wage;
}
public String getEmail() {
return email;
}
public String getPhoneNumber() {
return phoneNumber;
}
public String[] getPositions() {
return positions;
}
public Map<String, Shift> getAvailability() {
return Availability;
}
}
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