atrium-core-impl-robstoll-lib / ch.tutteli.atrium.reporting / DetailedObjectFormatter

DetailedObjectFormatter

class DetailedObjectFormatter : ObjectFormatter

Formats an object by using its toString representation, its Class.getName and its System.identityHashCode (in most cases).

Some objects are treated differently, refer to format for details.

The aim of representing more information than just toString is to avoid situations where an assert may fail and toString does not distinguish two compared objects. Consider the following error message "error, assert: 1 to be 1" would not be very helpful. "error, assert: 1 (Int <123>) to be 1 (Double <456>)" on the other hand is helpful.

Constructors

<init>

DetailedObjectFormatter(translator: Translator)

Formats an object by using its toString representation, its Class.getName and its System.identityHashCode (in most cases).

Functions

format

fun format(value: Any?): String

Returns a formatted version of the given value.