Class MaskConfig

java.lang.Object
ai.nightfall.scan.model.redaction.MaskConfig

public class MaskConfig extends Object
An object that specifies how findings should be masked when returned by the API.
  • Constructor Details

    • MaskConfig

      public MaskConfig()
      Default constructor; when no masking char is provided, defaults to '*'.
    • MaskConfig

      public MaskConfig(String maskingChar)
      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

      public MaskConfig(String maskingChar, String[] charsToIgnore)
      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

      public String getMaskingChar()
      Returns the masking character.
      Returns:
      the masking character
    • setMaskingChar

      public void setMaskingChar(String maskingChar)
      Sets the masking character.
      Parameters:
      maskingChar - the masking character
    • getCharsToIgnore

      public String[] getCharsToIgnore()
      Returns the characters to ignore during masking.
      Returns:
      the characters to ignore during masking
    • setCharsToIgnore

      public void setCharsToIgnore(String[] charsToIgnore)
      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

      public String toString()
      Overrides:
      toString in class Object