11package ai .nightfall .scan .model ;
22
3+ import ai .nightfall .scan .model .redaction .RedactionConfig ;
34import com .fasterxml .jackson .annotation .JsonProperty ;
45
56import java .util .List ;
1213public class Detector {
1314
1415 @ JsonProperty ("minConfidence" )
15- private String minConfidence ;
16+ private Confidence minConfidence ;
1617
1718 @ JsonProperty ("minNumFindings" )
1819 private int minNumFindings ;
@@ -41,6 +42,9 @@ public class Detector {
4142 @ JsonProperty ("exclusionRules" )
4243 private List <ExclusionRule > exclusionRules ;
4344
45+ @ JsonProperty ("redactionConfig" )
46+ private RedactionConfig redactionConfig ;
47+
4448 /**
4549 * Create an instance of a detector based on a pre-built Nightfall detector.
4650 *
@@ -87,17 +91,16 @@ public Detector(UUID detectorUUID) {
8791 *
8892 * @return the minimum confidence threshold required in order for a finding to be triggered
8993 */
90- public String getMinConfidence () {
94+ public Confidence getMinConfidence () {
9195 return minConfidence ;
9296 }
9397
9498 /**
9599 * Set the minimum confidence.
96100 *
97- * @param minConfidence the minimum confidence threshold. Valid values: <code>VERY_UNLIKELY</code>,
98- * <code>UNLIKELY</code>, <code>POSSIBLE</code>, <code>LIKELY</code>, <code>VERY_LIKELY</code>.
101+ * @param minConfidence the minimum confidence threshold.
99102 */
100- public void setMinConfidence (String minConfidence ) {
103+ public void setMinConfidence (Confidence minConfidence ) {
101104 this .minConfidence = minConfidence ;
102105 }
103106
@@ -222,6 +225,26 @@ public void setExclusionRules(List<ExclusionRule> exclusionRules) {
222225 this .exclusionRules = exclusionRules ;
223226 }
224227
228+ /**
229+ * Returns the redaction configuration to-be-applied to this detector. This configuration is currently only
230+ * supported for scanning plaintext, not for file scanning.
231+ *
232+ * @return the redaction configuration
233+ */
234+ public RedactionConfig getRedactionConfig () {
235+ return redactionConfig ;
236+ }
237+
238+ /**
239+ * Sets the redaction configuration to-be-applied to this detector. This configuration is currently only
240+ * supported for scanning plaintext, not for file scanning.
241+ *
242+ * @param redactionConfig the redaction configuration
243+ */
244+ public void setRedactionConfig (RedactionConfig redactionConfig ) {
245+ this .redactionConfig = redactionConfig ;
246+ }
247+
225248 @ Override
226249 public String toString () {
227250 return "Detector{"
@@ -235,6 +258,7 @@ public String toString() {
235258 + ", wordList=" + wordList
236259 + ", contextRules=" + contextRules
237260 + ", exclusionRules=" + exclusionRules
261+ + ", redactionConfig=" + redactionConfig
238262 + '}' ;
239263 }
240264}
0 commit comments