File tree 1 file changed +26
-0
lines changed
src/main/java/io/appium/java_client/imagecomparison
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 16
16
17
17
package io .appium .java_client .imagecomparison ;
18
18
19
+ import static java .util .Optional .ofNullable ;
20
+
21
+ import com .google .common .collect .ImmutableMap ;
22
+
23
+ import java .util .Map ;
24
+
19
25
public class OccurrenceMatchingOptions extends BaseComparisonOptions <OccurrenceMatchingOptions > {
26
+ private Double threshold ;
27
+
28
+ /**
29
+ * At what normalized threshold to reject an occurrence.
30
+ *
31
+ * @param threshold value in range 0..1. 0.5 is the default value.
32
+ * @return self instance for chaining.
33
+ */
34
+ public OccurrenceMatchingOptions withThreshold (double threshold ) {
35
+ this .threshold = threshold ;
36
+ return this ;
37
+ }
38
+
39
+ @ Override
40
+ public Map <String , Object > build () {
41
+ final ImmutableMap .Builder <String , Object > builder = ImmutableMap .builder ();
42
+ builder .putAll (super .build ());
43
+ ofNullable (threshold ).map (x -> builder .put ("threshold" , x ));
44
+ return builder .build ();
45
+ }
20
46
}
You can’t perform that action at this time.
0 commit comments