forked from reposense/RepoSense
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCliArguments.java
More file actions
76 lines (62 loc) · 2.07 KB
/
CliArguments.java
File metadata and controls
76 lines (62 loc) · 2.07 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package reposense.model;
import java.nio.file.Path;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;
/**
* Represents command line arguments user supplied when running the program.
*/
public abstract class CliArguments {
protected Path outputFilePath;
protected Date sinceDate;
protected Date untilDate;
protected boolean isSinceDateProvided;
protected boolean isUntilDateProvided;
protected List<FileType> formats;
protected boolean isAutomaticallyLaunching;
protected ZoneId zoneId;
public ZoneId getZoneId() {
return zoneId;
}
public Path getOutputFilePath() {
return outputFilePath;
}
public Date getSinceDate() {
return sinceDate;
}
public Date getUntilDate() {
return untilDate;
}
public boolean isSinceDateProvided() {
return isSinceDateProvided;
}
public boolean isUntilDateProvided() {
return isUntilDateProvided;
}
public List<FileType> getFormats() {
return formats;
}
public boolean isAutomaticallyLaunching() {
return isAutomaticallyLaunching;
}
@Override
public boolean equals(Object other) {
// short circuit if same object
if (this == other) {
return true;
}
// instanceof handles null
if (!(other instanceof CliArguments)) {
return false;
}
CliArguments otherCliArguments = (CliArguments) other;
return this.outputFilePath.equals(otherCliArguments.outputFilePath)
&& this.sinceDate.equals(otherCliArguments.sinceDate)
&& this.untilDate.equals(otherCliArguments.untilDate)
&& this.isSinceDateProvided == otherCliArguments.isSinceDateProvided
&& this.isUntilDateProvided == otherCliArguments.isUntilDateProvided
&& this.formats.equals(otherCliArguments.formats)
&& this.isAutomaticallyLaunching == otherCliArguments.isAutomaticallyLaunching
&& this.zoneId.equals(otherCliArguments.zoneId);
}
}