Interface ValueRenderer


@NullMarked public interface ValueRenderer
Prints a Java object value in a way humans can read it neatly. Used for printing arguments in verification errors.
Since:
5.25.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    Determines the order in which renders will be tried, if multiple renderers are available.
    @Nullable String
    print(@Nullable Object value)
    Prints given value so that it is neatly readable by humans.
  • Field Details

  • Method Details

    • getPluginPriority

      default int getPluginPriority()
      Determines the order in which renders will be tried, if multiple renderers are available. A higher number will be tried first. Renderers with the same priority will be ordered be classname.

      An internal fallback renderer will always be tried last, which can always render any object.

      Returns:
      a number indicating the priority of this renderer.
    • print

      @Nullable String print(@Nullable Object value)
      Prints given value so that it is neatly readable by humans. Must handle explosive toString() implementations. If a renderer implementation determines it cannot render this object, it indicates this by returning null.
      Returns:
      A string rendering of value, or null if the current renderer does not support this type of value.