Module : lang.value

Module Overview

This module provides lang library operations for all values defined by the language specification 2019R2.

Functions

clone

Returns a clone of value. A clone is a deep copy that does not copy immutable subtrees. A clone can therefore safely be used concurrently with the original. It corresponds to the Clone(v) abstract operation, defined in the Ballerina Language Specification.

cloneReadOnly

Returns a clone of value that is read-only, i.e. immutable. It corresponds to the ImmutableClone(v) abstract operation, defined in the Ballerina Language Specification.

fromJsonString

Parse a string in JSON format and return the the value that it represents. All numbers in the JSON will be represented as float values. Returns an error if the string cannot be parsed.

isReadOnly

Tests whether v is read-only, i.e. immutable Returns true if read-only, false otherwise.

mergeJson

Return the result of merging json value j1 with j2.

toJsonString

Return the string that represents v in JSON format.

toString

Returns a simple, human-readable representation of value as a string.