-
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathAdapterThreshold.java
More file actions
79 lines (69 loc) · 1.95 KB
/
AdapterThreshold.java
File metadata and controls
79 lines (69 loc) · 1.95 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
77
package io.jenkins.plugins.coverage;
/**
* Threshold used in {@link Adapter} in {@link CoveragePublisher}.
*/
public class AdapterThreshold extends AbstractThreshold {
private final Adapter adapter;
/**
* Constructor of an AdapterThreshold.
*
* @param adapter
* of threshold
* @param path
* to threshold
*/
public AdapterThreshold(Adapter adapter, String path) {
super(adapter, path);
this.adapter = adapter;
}
/**
* Setter for target of Threshold using {@link AdapterThresholdTarget}.
*
* @param adapterThresholdTarget
* of threshold
*/
public void setThresholdTarget(AdapterThresholdTarget adapterThresholdTarget) {
ensureAdvancedOptionsIsActivated();
this.getThresholdTarget().select(adapterThresholdTarget.getValue());
}
/**
* Ensures advanced options are activated so that values can be set.
*/
@Override
public void ensureAdvancedOptionsIsActivated() {
this.adapter.ensureAdvancedOptionsIsActivated();
}
/**
* Enum for Options of {@link AdapterThreshold}.
*/
public enum AdapterThresholdTarget {
AGGREGATED_REPORT("Aggregated Report"),
REPORT("Report"),
GROUP("Group"),
PACKAGE("Package"),
FILE("File"),
CLASS("Class"),
METHOD("Method"),
INSTRUCTION("Instruction"),
LINE("Line"),
CONDITIONAL("Conditional");
private final String value;
/**
* Constructor of enum.
*
* @param value
* is value-attribute of option-tag.
*/
AdapterThresholdTarget(String value) {
this.value = value;
}
/**
* Get value of option-tag which should be selected.
*
* @return value of option-tag to select.
*/
public String getValue() {
return value;
}
}
}