forked from utPLSQL/utPLSQL-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReporterOptions.java
More file actions
65 lines (49 loc) · 1.64 KB
/
ReporterOptions.java
File metadata and controls
65 lines (49 loc) · 1.64 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
package org.utplsql.cli;
import org.utplsql.api.reporter.Reporter;
/**
* Created by Vinicius on 20/05/2017.
*/
public class ReporterOptions {
private String reporterName;
private String outputFileName;
private boolean outputToScreen;
private boolean forceOutputToScreen;
private Reporter reporterObj = null;
public ReporterOptions(String reporterName, String outputFileName) {
setReporterName(reporterName);
setOutputFileName(outputFileName);
this.outputToScreen = (outputFileName == null); // If outputFileName is null we assume it should be sent to screen
this.forceOutputToScreen = false;
}
public ReporterOptions(String reporterName) {
this(reporterName, null);
}
public Reporter getReporterObj() {
return reporterObj;
}
public void setReporterObj(Reporter reporterObj) {
this.reporterObj = reporterObj;
}
public String getReporterName() {
return reporterName.toUpperCase();
}
public void setReporterName(String reporterName) {
this.reporterName = reporterName;
}
public String getOutputFileName() {
return outputFileName;
}
public void setOutputFileName(String outputFileName) {
this.outputFileName = outputFileName;
this.outputToScreen = false;
}
public boolean outputToFile() {
return outputFileName != null && !outputFileName.isEmpty();
}
public boolean outputToScreen() {
return outputToScreen || forceOutputToScreen;
}
public void forceOutputToScreen(boolean outputToScreen) {
this.forceOutputToScreen = outputToScreen;
}
}