Interface MaskRenderer

All Known Implementing Classes:
DefaultMaskRenderer

@API(status=MAINTAINED) public interface MaskRenderer
Renders confidential values for generated contract violation messages.

Implementations are used when Contract.Mask applies to a parameter or return value. A renderer receives the raw value that would otherwise be rendered in a violation message and must return a representation that is safe to include in exception text.

Custom renderers must not leak confidential data unless the application has explicitly approved that representation. For highly sensitive values, prefer fixed text that does not reveal content, length, or structure.

  • Method Summary

    Modifier and Type
    Method
    Description
    render(@Nullable Object value)
    Renders a confidential value for a violation message.
  • Method Details

    • render

      String render(@Nullable Object value)
      Renders a confidential value for a violation message.
      Parameters:
      value - the raw value; may be null
      Returns:
      the message-safe representation