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 -
Method Summary
Modifier and TypeMethodDescriptiondefault intDetermines the order in which renders will be tried, if multiple renderers are available.@Nullable StringPrints given value so that it is neatly readable by humans.
-
Field Details
-
DEFAULT_PRIORITY
static final int DEFAULT_PRIORITY- See Also:
-
-
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
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, ornullif the current renderer does not support this type of value.
-