1
1
package io .jenkins .plugins .coverage .metrics .model ;
2
2
3
- import java .util .List ;
4
- import java .util .NavigableMap ;
5
- import java .util .NoSuchElementException ;
6
- import java .util .Optional ;
7
-
8
3
import edu .hm .hafner .coverage .Difference ;
9
4
import edu .hm .hafner .coverage .Metric ;
10
5
import edu .hm .hafner .coverage .Value ;
11
6
7
+ import java .util .List ;
8
+ import java .util .NoSuchElementException ;
9
+ import java .util .Optional ;
10
+
12
11
/**
13
12
* Provides statistics for values and differences for all Base the different mappings of coverage metric and baseline to actual values.
14
13
*/
@@ -110,21 +109,17 @@ public double roundValue(final Metric metric) {
110
109
return roundValue (Baseline .PROJECT , metric );
111
110
}
112
111
113
- private Optional <Value > getValue (final Metric metric , final NavigableMap <Metric , Difference > mapping ) {
114
- return Optional .ofNullable (mapping .get (metric ));
115
- }
116
-
117
112
/**
118
113
* Returns whether a value for the specified metric and baseline is available.
119
114
*
120
- * @param baseline
121
- * the baseline of the value
122
115
* @param metric
123
116
* the metric of the value
117
+ * @param baseline
118
+ * the baseline of the value
124
119
*
125
120
* @return {@code true}, if a value is available, {@code false} otherwise
126
121
*/
127
- public boolean containsValue (final Baseline baseline , final Metric metric ) {
122
+ public boolean containsValue (final Metric metric , final Baseline baseline ) {
128
123
return getValue (baseline , metric ).isPresent ();
129
124
}
130
125
@@ -136,8 +131,7 @@ public boolean containsValue(final Baseline baseline, final Metric metric) {
136
131
*
137
132
* @return {@code true}, if a value is available, {@code false} otherwise
138
133
*/
139
- // FIXME: reoder overloaded name
140
134
public boolean containsValue (final Metric metric ) {
141
- return containsValue (Baseline .PROJECT , metric );
135
+ return containsValue (metric , Baseline .PROJECT );
142
136
}
143
137
}
0 commit comments