Package ai.nightfall.scan.model
Class Detector
java.lang.Object
ai.nightfall.scan.model.Detector
An object that represents a data type or category of information. Detectors are used to scan content
for findings.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an instance of a detector based on a regular expression.Create an instance of a detector based on a word list.Create an instance of a detector based on a pre-built Nightfall detector.Create an instance of a detector by using an existing detector's UUID. -
Method Summary
Modifier and TypeMethodDescriptionGet the context rules.Get the detector type.Get the detector UUID.Get the display name.Get the exclusion rules.Return the minimum confidence.intGet the minimum number of findings.Get the nightfall detector.Returns the redaction configuration to-be-applied to this detector.getRegex()Get the regex.Get the word list.voidsetContextRules(List<ContextRule> contextRules) Set the context rules.voidsetDisplayName(String displayName) Set the display name.voidsetExclusionRules(List<ExclusionRule> exclusionRules) Set the exclusion rules.voidsetMinConfidence(Confidence minConfidence) Set the minimum confidence.voidsetMinNumFindings(int minNumFindings) Set the minimum number of findings.voidsetRedactionConfig(RedactionConfig redactionConfig) Sets the redaction configuration to-be-applied to this detector.toString()
-
Constructor Details
-
Detector
Create an instance of a detector based on a pre-built Nightfall detector.- Parameters:
nightfallDetector- the name of a pre-built Nightfall detector
-
Detector
Create an instance of a detector based on a regular expression.- Parameters:
regex- the regular expression configuration
-
Detector
Create an instance of a detector based on a word list.- Parameters:
wordList- the word list configuration
-
Detector
Create an instance of a detector by using an existing detector's UUID.- Parameters:
detectorUUID- an existing detector's UUID
-
-
Method Details
-
getMinConfidence
Return the minimum confidence.- Returns:
- the minimum confidence threshold required in order for a finding to be triggered
-
setMinConfidence
Set the minimum confidence.- Parameters:
minConfidence- the minimum confidence threshold.
-
getMinNumFindings
public int getMinNumFindings()Get the minimum number of findings.- Returns:
- the minimum number of occurrences of the detector required to trigger a finding match
-
setMinNumFindings
public void setMinNumFindings(int minNumFindings) Set the minimum number of findings.- Parameters:
minNumFindings- the minimum number of occurrences of the detector required to trigger a finding match
-
getDetectorUUID
Get the detector UUID.- Returns:
- a UUID that represents a pre-built detector
-
getDisplayName
Get the display name.- Returns:
- a display name for this detector
-
setDisplayName
Set the display name.- Parameters:
displayName- a display name for this detector
-
getDetectorType
Get the detector type.- Returns:
- the type of this detector. Valid values are
NIGHTFALL_DETECTOR,REGEX, andWORD_LIST.
-
getNightfallDetector
Get the nightfall detector.- Returns:
- the pre-built Nightfall Detector to use. This field is only used if the Detector was constructed with a Nightfall Detector argument.
-
getRegex
Get the regex.- Returns:
- the regular expression representing this detector. This field is only used if the Detector was constructed with a regex argument.
-
getWordList
Get the word list.- Returns:
- the word list representing this detector. This field is only used if the Detector was constructed with a word list argument.
-
getContextRules
Get the context rules.- Returns:
- the context rules that will be used to customize the behavior of this detector
-
setContextRules
Set the context rules.- Parameters:
contextRules- the context rules to use to customize the behavior of this detector
-
getExclusionRules
Get the exclusion rules.- Returns:
- the exclusion rules that will be used to customize the behavior of this detector
-
setExclusionRules
Set the exclusion rules.- Parameters:
exclusionRules- the exclusion rules to use to customize the behavior of this detector
-
getRedactionConfig
Returns the redaction configuration to-be-applied to this detector. This configuration is currently only supported for scanning plaintext, not for file scanning.- Returns:
- the redaction configuration
-
setRedactionConfig
Sets the redaction configuration to-be-applied to this detector. This configuration is currently only supported for scanning plaintext, not for file scanning.- Parameters:
redactionConfig- the redaction configuration
-
toString
-