toJson

open fun toJson(@NonNull value: Value): String

Converts value to a JSON string. The method is intended to be used when `machine-readable` string is needed.

Return

string The value converted to a JSON string.

Parameters

value

The value to be converted.


open fun toJson(@NonNull value: Value, indent: Int): String

Converts value to a `human-readable` JSON string. Space (0x20) character is used for indentation.

Return

string The value converted to a JSON string.

Parameters

value

The value to be converted.

indent

The indentation level for converted JSON.