-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommit.java
53 lines (43 loc) · 1.14 KB
/
Commit.java
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package gitlet;
import java.io.Serializable;
import java.util.HashMap;
/** Represents a gitlet commit object.
*
* does at a high level.
*
* @author TODO
*/
public class Commit implements Serializable {
/**
*
*
* List all instance variables of the Commit class here with a useful
* comment above them describing what that variable represents and how that
* variable is used. We've provided one example for `message`.
*/
/** The message of this Commit. */
protected HashMap<String, String> files;
protected String date;
protected String message;
protected Commit parentOne;
protected Commit parentTwo;
public Commit(HashMap<String, String> f, String d, String m, Commit parent1, Commit parent2) {
files = f;
date = d;
message = m;
parentOne = parent1;
parentTwo = parent2;
}
public String getMessage() {
return message;
}
public String getDate() {
return date;
}
public HashMap<String, String> getFiles() {
return files;
}
public void printFile() {
System.out.println(files);
}
}