77 * Confidence level of a field as returned by the V2 API.
88 */
99public enum FieldConfidence {
10- Certain ("Certain" ),
11- High ("High" ),
10+ Low ("Low" ),
1211 Medium ("Medium" ),
13- Low ("Low" );
12+ High ("High" ),
13+ Certain ("Certain" );
1414
1515 private final String json ;
1616
@@ -35,4 +35,52 @@ public static FieldConfidence fromJson(String value) {
3535 }
3636 throw new IllegalArgumentException ("Unknown confidence level '" + value + "'." );
3737 }
38+
39+ /**
40+ * Compares the current FieldConfidence level with another FieldConfidence level
41+ * to determine if the current level is greater.
42+ *
43+ * @param other the other FieldConfidence level to compare against
44+ * @return true if the current FieldConfidence level is greater than the specified level,
45+ * false otherwise
46+ */
47+ public boolean greaterThan (FieldConfidence other ) {
48+ return this .compareTo (other ) > 0 ;
49+ }
50+
51+ /**
52+ * Compares the current FieldConfidence level with another FieldConfidence level
53+ * to determine if the current level is greater than or equal to the specified level.
54+ *
55+ * @param other the other FieldConfidence level to compare against
56+ * @return true if the current FieldConfidence level is greater than or equal to the specified level,
57+ * false otherwise
58+ */
59+ public boolean greaterThanOrEqual (FieldConfidence other ) {
60+ return this .compareTo (other ) >= 0 ;
61+ }
62+
63+ /**
64+ * Compares the current FieldConfidence level with another FieldConfidence level
65+ * to determine if the current level is less than the specified level.
66+ *
67+ * @param other the other FieldConfidence level to compare against
68+ * @return true if the current FieldConfidence level is less than the specified level,
69+ * false otherwise
70+ */
71+ public boolean lessThan (FieldConfidence other ) {
72+ return this .compareTo (other ) < 0 ;
73+ }
74+
75+ /**
76+ * Compares the current FieldConfidence level with another FieldConfidence level
77+ * to determine if the current level is less than or equal to the specified level.
78+ *
79+ * @param other the other FieldConfidence level to compare against
80+ * @return true if the current FieldConfidence level is less than or equal to the specified level,
81+ * false otherwise
82+ */
83+ public boolean lessThanOrEqual (FieldConfidence other ) {
84+ return this .compareTo (other ) <= 0 ;
85+ }
3886}
0 commit comments