Class MaskConfig
java.lang.Object
ai.nightfall.scan.model.redaction.MaskConfig
An object that specifies how findings should be masked when returned by the API.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor; when no masking char is provided, defaults to '*'.MaskConfig(String maskingChar) Builds a masking configuration with the provided masking character.MaskConfig(String maskingChar, String[] charsToIgnore) Builds a masking configuration with the provided masking character and characters to ignore. -
Method Summary
Modifier and TypeMethodDescriptionString[]Returns the characters to ignore during masking.Returns the masking character.intReturns the number of characters to leave unmasked, defaults to 0.booleanReturns true if masking should be applied left-to-right, false otherwise.voidsetCharsToIgnore(String[] charsToIgnore) Sets the characters to ignore during masking.voidsetMaskingChar(String maskingChar) Sets the masking character.voidsetMaskLeftToRight(boolean maskLeftToRight) Sets whether masking should be applied left-to-right.voidsetNumCharsToLeaveUnmasked(int numCharsToLeaveUnmasked) Sets the number of characters to leave unmasked.toString()
-
Constructor Details
-
MaskConfig
public MaskConfig()Default constructor; when no masking char is provided, defaults to '*'. -
MaskConfig
Builds a masking configuration with the provided masking character.- Parameters:
maskingChar- the masking character; this character may be a multi-byte character, but it must be exactly one codepoint.
-
MaskConfig
Builds a masking configuration with the provided masking character and characters to ignore.- Parameters:
maskingChar- the masking character; this character may be a multi-byte character, but it must be exactly one codepoint.charsToIgnore- the set of characters to leave unmasked when the finding is returned. These characters may be multi-byte characters, but each entry in the array must be exactly one codepoint.
-
-
Method Details
-
getMaskingChar
Returns the masking character.- Returns:
- the masking character
-
setMaskingChar
Sets the masking character.- Parameters:
maskingChar- the masking character
-
getCharsToIgnore
Returns the characters to ignore during masking.- Returns:
- the characters to ignore during masking
-
setCharsToIgnore
Sets the characters to ignore during masking.- Parameters:
charsToIgnore- the characters to ignore during masking
-
getNumCharsToLeaveUnmasked
public int getNumCharsToLeaveUnmasked()Returns the number of characters to leave unmasked, defaults to 0.- Returns:
- the number of characters to leave unmasked, defaults to 0
-
setNumCharsToLeaveUnmasked
public void setNumCharsToLeaveUnmasked(int numCharsToLeaveUnmasked) Sets the number of characters to leave unmasked.- Parameters:
numCharsToLeaveUnmasked- the number of characters to leave unmasked
-
isMaskLeftToRight
public boolean isMaskLeftToRight()Returns true if masking should be applied left-to-right, false otherwise. Defaults to false.- Returns:
- true if masking should be applied left-to-right, false otherwise
-
setMaskLeftToRight
public void setMaskLeftToRight(boolean maskLeftToRight) Sets whether masking should be applied left-to-right.- Parameters:
maskLeftToRight- true if masking should be applied left-to-right, false otherwise
-
toString
-