Module : lang.value

Module Overview

This module provides lang library operations common to all values defined by the language specification 2019R3.

Functions

clone

Returns a clone of v. 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 v that is read-only, i.e. immutable. It corresponds to the ImmutableClone(v) abstract operation, defined in the Ballerina Language Specification.

fromJsonString

Parses a string in JSON format and returns 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

Merges two json values.

toJsonString

Returns the string that represents v in JSON format.

toString

Performs a minimal conversion of a value to a string. The conversion is minimal in particular in the sense that the conversion applied to a value that is already a string does nothing.