format

abstract fun format(value: Any?): String(source)

Returns a formatted version of the given value.

Following the minimum requirements for an ObjectFormatter:

Besides that it is up to the concrete implementation how it formats value. Nonetheless, following some conventions:

  • return "true" in case value is true

  • return "false" in case value is false

  • wrap Char in apostrophes (e.g. "'a'")

  • wrap CharSequence in quotes (e.g. "\"hello\"")

Return

The formatted value.

Parameters

value

The value which shall be formatted.