- Companion:
- object
Value members
Abstract methods
Selects all the values of this Json which satisfy a predicate and are not Jsons. When a Json is found, it is filtered recursively.
Selects all the values of this Json which satisfy a predicate and are not Jsons. When a Json is found, it is filtered recursively.
- Value parameters:
- p
the predicate uses to test elements. The predicate accepts the path/json.value pair of each element
- Returns:
a new Json consisting of all elements of this Json that satisfy the given predicate p.
Selects all the values of this Json which satisfy a predicate and are not Jsons. When a Json is found, it is filtered recursively.
Selects all the values of this Json which satisfy a predicate and are not Jsons. When a Json is found, it is filtered recursively.
- Value parameters:
- p
the predicate uses to test elements. The predicate accepts the json.value of each element
- Returns:
a new Json consisting of all elements of this Json that satisfy the given predicate p.
Removes all the Json object of this Json which dont' satisfy a predicate. When a Json is found, it is filtered recursively (if it passes the filter).
Removes all the Json object of this Json which dont' satisfy a predicate. When a Json is found, it is filtered recursively (if it passes the filter).
- Value parameters:
- p
the predicate uses to test the path/object pairs.
- Returns:
a new Json consisting of all its elements except those Json object that dont satisfy the given predicate p.
Removes all the Json object of this Json which dont' satisfy a predicate. When a Json is found, it is filtered recursively (if it passes the filter).
Removes all the Json object of this Json which dont' satisfy a predicate. When a Json is found, it is filtered recursively (if it passes the filter).
- Value parameters:
- p
the predicate uses to test the Json object.
- Returns:
a new Json consisting of all its elements except those Json object that dont satisfy the given predicate p.
Removes all the keys of this Json which dont' satisfy a predicate. When a Json is found, it is filtered recursively.
Removes all the keys of this Json which dont' satisfy a predicate. When a Json is found, it is filtered recursively.
- Value parameters:
- p
the predicate uses to test the path/json.value pairs.
- Returns:
a new Json consisting of all array elements of this Json and those key/json.value pairs that satisfy the given predicate p.
Removes all the keys of this Json which dont' satisfy a predicate. When a Json is found, it is filtered recursively.
Removes all the keys of this Json which dont' satisfy a predicate. When a Json is found, it is filtered recursively.
- Value parameters:
- p
the predicate uses to test the keys.
- Returns:
a new Json consisting of all array elements of this Json and those key/json.value pairs that satisfy the given predicate p.
The initial part of the Json object without its last element.
The initial part of the Json object without its last element.
returns true if the Json is empty
returns true if the Json is empty
- Returns:
true if empty, false otherwise
Builds a new Json by applying a function to all elements of this Json that are not Json and satisfies a given predicate. When a Json is found, it it mapped recursively.
Builds a new Json by applying a function to all elements of this Json that are not Json and satisfies a given predicate. When a Json is found, it it mapped recursively.
- Value parameters:
- m
the function to apply to each element. The predicate accepts the path/json.value pair of each element
- p
filter to select which elements will be mapped. By default all the elements are selected.
- Returns:
a new Json resulting from applying the given map function to each element of this Json that satisfies the filter and collecting the results.
Builds a new Json by applying a function to all elements of this Json that are not Json. When a Json is found, it it mapped recursively.
Builds a new Json by applying a function to all elements of this Json that are not Json. When a Json is found, it it mapped recursively.
- Value parameters:
- m
the function to apply to each element. It accepts the json.value of each element
- Returns:
a new Json resulting from applying the given map function to each element of this Json that satisfies the filter and collecting the results.
Builds a new Json by applying a function to all the keys of this Json that satisfies a given predicate. If the element associated to a key is a Json, the function is applied recursively,
Builds a new Json by applying a function to all the keys of this Json that satisfies a given predicate. If the element associated to a key is a Json, the function is applied recursively,
- Value parameters:
- m
the function to apply to each key. It accepts the path/json.value pair as parameters
- p
the predicate to select which keys will be mapped
Builds a new Json by applying a function to all the keys of this Json. If the element associated to a key is a Json, the function is applied recursively,
Builds a new Json by applying a function to all the keys of this Json. If the element associated to a key is a Json, the function is applied recursively,
- Value parameters:
- m
the function to apply to each key. It accepts the key name as a parameter
Removes a path from this Json
Removes a path from this Json
- Value parameters:
- path
the path to be removed
- Returns:
If this Json does not contain a binding for path it is returned unchanged. Otherwise, returns a new Json without a binding for path
Serialize this Json into an array of bytes. When possible, it's more efficient to work on byte level that with strings
Serialize this Json into an array of bytes. When possible, it's more efficient to work on byte level that with strings
- Returns:
this Json serialized into an array of bytes
The rest of the Json object without its first element.
The rest of the Json object without its first element.
Converts the string representation of this Json to a pretty print version
Converts the string representation of this Json to a pretty print version
- Returns:
pretty print version of the string representation of this Json
Returns the string representation of this Json
Returns the string representation of this Json
- Returns:
the string representation of this Json
- Definition Classes
- Any
Creates a new Json obtained by inserting a given path/json.value pair into this Json. The given element is always inserted at the given path, even if it requires to create new Json or padding arrays.
Creates a new Json obtained by inserting a given path/json.value pair into this Json. The given element is always inserted at the given path, even if it requires to create new Json or padding arrays.
- Value parameters:
- path
the path
- value
the json.value
- Returns:
A new Json with the new path/json.value mapping added to this Json.
Concrete methods
Returns the element located at a specified path. This function is total on its argument. If no element is found, JsNothing is returned
Returns the element located at a specified path. This function is total on its argument. If no element is found, JsNothing is returned
- Value parameters:
- path
the path
- Returns:
the json value found at the path
returns true if the Json is non empty
returns true if the Json is non empty
- Returns:
true if non empty, false otherwise
Returns a zero-argument function that when called, it serializes this Json into the given output stream, no returning anything
Returns a zero-argument function that when called, it serializes this Json into the given output stream, no returning anything
- Value parameters:
- outputStream
the output stream
- Returns:
() => Unit function that serializes this Json into the given output stream