-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntity.java
More file actions
39 lines (32 loc) · 1.19 KB
/
Entity.java
File metadata and controls
39 lines (32 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import java.util.Set;
import java.time.format.DateTimeFormatter;
import java.util.Scanner;
/**
* COMP90041, Sem2, 2022: Final Project
* <p>Class Entity has variables related to timestamp, degree, salary, summary for jobs and applicants objects. Methdd included is create object
* taking command line input
* @author Gia Han Ly
*/
public abstract class Entity {
// Valid choices for Gender and Degree
protected static final Set<String> GENDER_LIST = Set.of("female", "other", "male");
protected static final Set<String> DEGREE = Set.of("Bachelor", "Master", "PHD");
// Format for parsing date time
protected static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yy");
protected long createdAt;
protected String degree;
protected int salary;
protected String summary;
protected double wam;
/**
* Abstract method to create object of type Entity using user input
* @param scanner
* @return Entity
*/
protected abstract Entity create(Scanner scanner);
/**
* Abstract method to read object of type Entity from file
* @param fileName - file name
*/
protected abstract void read(String fileName);
}