File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
src/main/java/io/appium/java_client/imagecomparison Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1616
1717package io .appium .java_client .imagecomparison ;
1818
19+ import static java .util .Optional .ofNullable ;
20+
21+ import com .google .common .collect .ImmutableMap ;
22+
23+ import java .util .Map ;
24+
1925public 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+ }
2046}
You can’t perform that action at this time.
0 commit comments