Class PartialMaskingFunction

All Implemented Interfaces:
AssignmentTestable, Function, ScalarFunction

public class PartialMaskingFunction extends MaskingFunction
A MaskingFunction applied to a StringType value that, depending on PartialMaskingFunction.Kind:
  • Replaces each character between the supplied positions by the supplied padding character. In other words, it will mask all the characters except the first m and last n.
  • Replaces each character before and after the supplied positions by the supplied padding character. In other words, it will only mask all the first m and last n characters.
The returned value will allways be of the same type as the first string-based argument.
  • Field Details

    • DEFAULT_PADDING_CHAR

      public static final char DEFAULT_PADDING_CHAR
      The character to be used as padding if no other character is supplied when calling the function.
      See Also:
  • Method Details

    • newArguments

      public Arguments newArguments(ProtocolVersion version)
      Description copied from interface: Function
      Creates some new input arguments for this function.
      Specified by:
      newArguments in interface Function
      Overrides:
      newArguments in class NativeFunction
      Parameters:
      version - the protocol version
      Returns:
      some new input arguments for this function
    • execute

      public ByteBuffer execute(Arguments arguments) throws InvalidRequestException
      Description copied from interface: ScalarFunction
      Applies this function to the specified arguments.
      Parameters:
      arguments - the input arguments for the function
      Returns:
      the result of applying this function to the arguments
      Throws:
      InvalidRequestException - if this function cannot not be applied to the arguments
    • factories

      public static Collection<FunctionFactory> factories()
      Returns:
      a collection of function factories to build new PartialMaskingFunction functions.