xtr¶
contains¶
Array contains¶
contains(arr: Array, value: Any): Boolean
Returns true
if arr
contains the given value
, otherwise false
.
Example
ResultString contains¶
contains(str1: String, str2: String): Boolean
Returns true
if str1
contains str2
, otherwise false
.
Example
ResultendsWith¶
endsWith(str1: String, str2: String): String
Returns true
if str1
ends with str2
, otherwise false
.
Example
Resultentries¶
entries(obj: Object[A]): Array[Object[String|A]]
Returns an Array[Object[String|A]]
with one Object[String|A]
for every entry in obj
. The result has the form of [{ key: String, value: A }]
.
Example
Resultfilter¶
filter func(value)¶
filter(arr: Array[A], predicate Func[(A) => Boolean]): Array[A]
Returns a new Array[A]
containing the elements of arr
that satisfy the given predicate
, which must accept an A
value to test.
Example
Resultfilter func(value, idx)¶
filter(arr: Array[A], predicate Func[(A, Number) => Boolean]): Array[A]
Returns a new Array[A]
containing the elements of arr
that satisfy the given predicate
, which must accept an A
value and its Number
index to test.
Example
ResultfilterNotEq¶
filterNotEq(arr: Array[A], value: B): Array[A]
Returns a new Array[A]
containing the elements of arr
that are not equal to the given value
.
Example
ResultfilterNotIn¶
filterNotIn(arr: Array[A], arr2: Array[B]): Array[A]
Returns a new Array[A]
containing the elements of arr1
that are not in the given arr2
.
Example
ResultfilterObject¶
filterObject func(value)¶
filterObject(obj: Object[A], predicate: Func[(A) => Boolean]): Object[A]
Returns a new Object[A]
containing the entries of obj
that satisfy the given predicate
, which must accept an A
value to test.
Example
local languages = {
scala: { version: '3.1.3', isJvm: true },
java: { version: '19', isJvm: true },
python: { version: '3.10.4', isJvm: false }
};
xtr.filterObject(languages, function(lang) lang.isJvm)
filterObject func(value, key)¶
filterObject(obj: Object[A], predicate: Func[(A, String) => Boolean]): Object[A]
Returns a new Object[A]
containing the entries of obj
that satisfy the given predicate
, which must accept an A
value and its corresponding String
key to test.
Example
local languages = {
scala: { version: '3.1.3', isJvm: true },
java: { version: '19', isJvm: true },
python: { version: '3.10.4', isJvm: false }
};
xtr.filterObject(languages, function(lang, name) !lang.isJvm || name == 'scala')
filterObject func(value, key, idx)¶
filterObject(obj: Object[A], predicate: Func[(A, String, Number) => Boolean]): Object[A]
Returns a new Object[A]
containing the entries of obj
that satisfy the given predicate
, which must accept an A
value and its corresponding String
key and Number
index to test.
Example
local languages = {
scala: { version: '3.1.3', isJvm: true },
java: { version: '19', isJvm: true },
python: { version: '3.10.4', isJvm: false }
};
xtr.filterObject(languages, function(lang, name, idx) idx == 0 || name == 'python')
flatMap¶
flatMap func(value)¶
flatMap(arr: Array[A], function: Func[(A) => Array[B]]): Array[B]
Returns a new Array[B]
containing the elements of every Array[B]
obtained by applying the given function
to all elements in arr
. function
must accept an A
value.
Example
ResultflatMap func(value, idx)¶
flatMap(arr: Array[A], function: Func[(A, Number) => Array[B]]): Array[B]
Returns a new Array[B]
containing the elements of every Array[B]
obtained by applying the given function
to all elements in arr
. function
must accept an A
value and its Number
index.
Example
ResultflatMapObject¶
flatMapObject func(value)¶
flatMapObject(obj: Object[A], function: Func[(A) => Object[B]]): Object[B]
Returns a new Object[B]
containing the entries of every Object[B]
obtained by applying the given function
to all entries in obj
. function
must accept an A
value.
Example
local candidateReqs = {
req1: { skillsType: 'dev', required: ['java'], preferred: ['unit-testing'] },
req2: { skillsType: 'ops', required: ['containers'], preferred: ['kubernetes'] }
};
local reqsWeight(req) = {
[req.required[0]]: 5,
[req.preferred[0]]: 2,
[if req.skillsType == 'dev' then 'github']: 4,
[if req.skillsType == 'ops' then 'jenkins']: 4
};
xtr.flatMapObject(candidateReqs, reqsWeight)
flatMapObject func(value, key)¶
flatMapObject(obj: Object[A], function: Func[(A, String) => Object[B]]): Object[B]
Returns a new Object[B]
containing the entries of every Object[B]
obtained by applying the given function
to all entries in obj
. function
must accept an A
value and its corresponding String
key.
Example
local candidateReqs = {
dev: { required: ['java'], preferred: ['unit-testing'] },
ops: { required: ['containers'], preferred: ['kubernetes'] }
};
local reqsWeight(req, type) = {
[req.required[0]]: 5,
[req.preferred[0]]: 2,
[if type == 'dev' then 'github']: 4,
[if type == 'ops' then 'jenkins']: 4
};
xtr.flatMapObject(candidateReqs, reqsWeight)
flatMapObject func(value, key, idx)¶
flatMapObject(obj: Object[A], function: Func[(A, String, Number) => Object[B]]): Object[B]
Returns a new Object[B]
containing the entries of every Object[B]
obtained by applying the given function
to all entries in obj
. function
must accept an A
value and its corresponding String
key and Number
index.
Example
local candidateReqs = {
dev: { required: ['java'], preferred: ['unit-testing'] },
ops: { required: ['containers'], preferred: ['kubernetes'] }
};
local reqsWeight(req, type, idx) = {
[req.required[0]]: 5,
[req.preferred[0]]: if idx == 0 then 3 else 1,
[if type == 'dev' then 'github']: if idx == 0 then 4 else 2,
[if type == 'ops' then 'jenkins']: if idx == 0 then 4 else 2
};
xtr.flatMapObject(candidateReqs, reqsWeight)
flatten¶
flatten(arr: Array[Array[A]]): Array[A]
Returns a new Array[A]
containing the elements of every Array[A]
in arr
.
Example
ResultfoldLeft¶
foldLeft(arr: Array[A], initValue: Any, function: Func[(A, Any) => Any]): Any
From left to right in arr
, applies the given function
to the first element with initValue
, then applies it to every subsequent element with the result of the previous invocation. function
must accept an A
value and Any
value, which is initValue
for the first invocation, and the result of the previous one for all others.
Returns the Any
result of the final function
invocation.
Hint
fold
functions usually mutate the "accumulator" value on each invocation, thus "folding" the collection into a single value.
Example
ResultfoldRight¶
foldRight(arr: Array[A], initValue: Any, Func[(A, Any) => Any]): Any
From right to left in arr
, applies the given function
to the first element with initValue
, then applies it to every subsequent element with the result of the previous invocation. function
must accept an A
value and Any
value, which is initValue
for the first invocation, and the result of the previous one for all others.
Returns the Any
result of the final function
invocation.
Hint
fold
functions usually mutate the "accumulator" value on each invocation, thus "folding" the collection into a single value.
Example
ResultgroupBy¶
Array groupBy func(value)¶
groupBy(arr: Array[A], Func[(A) => String]): Object[Array[A]]
Returns an Object[Array[A]]
where the keys are the results of applying the given function
to all elements in arr
, and their corresponding values are the arr
elements for which the function
invocation resulted in such key. function
must accept an A
value.
Example
local languages = [
{ name: 'scala', version: '3.1.3', isJvm: true },
{ name: 'java', version: '19', isJvm: true },
{ name: 'python', version: '3.10.4', isJvm: false }
];
xtr.groupBy(languages, function(lang) if lang.isJvm then 'jvmLangs' else 'others')
{
jvmLangs: [
{ name: 'scala', version: '3.1.3', isJvm: true },
{ name: 'java', version: '19', isJvm: true }
],
others: [{ name: 'python', version: '3.10.4', isJvm: false }]
}
Array groupBy func(value, idx)¶
groupBy(arr: Array[A], Func[(A, Number) => String]): Object[Array[A]]
Returns an Object[Array[A]]
where the keys are the results of applying the given function
to all elements in arr
, and their corresponding values are the arr
elements for which the function
invocation resulted in such key. function
must accept an A
value and its Number
index.
Example
local languages = [
{ name: 'scala', version: '3.1.3', isJvm: true },
{ name: 'java', version: '19', isJvm: true },
{ name: 'python', version: '3.10.4', isJvm: false }
];
local langFunc(lang, idx) = if idx == 0 then 'preferred'
else if lang.isJvm then 'jvmLangs'
else 'others';
xtr.groupBy(languages, langFunc)
{
preferred: [{ name: 'scala', version: '3.1.3', isJvm: true }],
jvmLangs: [{ name: 'java', version: '19', isJvm: true }],
others: [{ name: 'python', version: '3.10.4', isJvm: false }]
}
Object groupBy func(value)¶
groupBy(obj: Object[A], Func[(A) => String]): Object[Object[A]]
Returns an Object[Object[A]]
where the keys are the results of applying the given function
to all elements in arr
, and their corresponding values are the arr
elements for which the function
invocation resulted in such key. function
must accept an A
value.
Example
local languages = {
scala: { version: '3.1.3', isJvm: true, project: 'scala-lang.org' },
java: { version: '19', isJvm: true, project: 'jdk.java.net' },
python: { version: '3.10.4', isJvm: false, project: 'python.org' }
};
xtr.groupBy(languages, function(lang) if lang.isJvm then 'jvmLangs' else 'others')
{
jvmLangs: {
scala: { version: '3.1.3', isJvm: true, project: 'scala-lang.org' },
java: { version: '19', isJvm: true, project: 'jdk.java.net' }
},
others: { python: { version: '3.10.4', isJvm: false, project: 'python.org' }}
}
Object groupBy func(value, key)¶
groupBy(obj: Object[A], Func[(A, String) => String]): Object[Object[A]]
Returns an Object[Object[A]]
where the keys are the results of applying the given function
to all elements in arr
, and their corresponding values are the arr
elements for which the function
invocation resulted in such key.function
must accept an A
value and its corresponding String
key.
Example
local languages = {
scala: { version: '3.1.3', isJvm: true, project: 'scala-lang.org' },
java: { version: '19', isJvm: true, project: 'jdk.java.net' },
python: { version: '3.10.4', isJvm: false, project: 'python.org' }
};
local langFunc(lang, name) = if name == 'scala' then 'preferred'
else if lang.isJvm then 'jvmLangs'
else 'others';
xtr.groupBy(languages, langFunc)
{
preferred: { scala: { version: '3.1.3', isJvm: true, project: 'scala-lang.org' }},
jvmLangs: { java: { version: '19', isJvm: true, project: 'jdk.java.net' }},
others: { python: { version: '3.10.4', isJvm: false, project: 'python.org' }}
}
indicesOf¶
Array indicesOf¶
indicesOf(arr: Array, value: Any): Array[Number]
Returns an Array[Number]
with the indices of the elements in arr
that equal value
.
Example
ResultString indicesOf¶
indicesOf(str1: String, str2: String): Array[Number]
Returns an Array[Number]
with the indices of the substrings in str1
that equal str2
.
Example
ResultisArray¶
isArray(value: Any): Boolean
Returns true
if value
is an Array
, otherwise false
.
Example
ResultisBlank¶
isBlank(str: String): Boolean
Returns true
if str
is empty or contains whitespace characters only, otherwise false
.
Example
ResultisBoolean¶
isBoolean(value: Any): Boolean
Returns true
if value
is a Boolean
, otherwise false
.
Example
ResultisDecimal¶
isDecimal(num: Number): Boolean
Returns true
if num
is a decimal, otherwise false
.
Example
ResultisEmpty¶
Array isEmpty¶
isEmpty(arr: Array): Boolean
Returns true
if arr
is empty, otherwise false
.
Example
ResultObject isEmpty¶
isEmpty(obj: Object): Boolean
Returns true
if obj
is empty, otherwise false
.
Example
ResultString isEmpty¶
isEmpty(str: String): Boolean
Returns true
if str
is empty, otherwise false
.
Example
ResultisFunction¶
isFunction(value: Any): Boolean
Returns true
if value
is a Function
, otherwise false
.
Example
ResultisInteger¶
isInteger(num: Number): Boolean
Returns true
if num
is an integer, otherwise false
.
Example
ResultisNumber¶
isNumber(value: Any): Boolean
Returns true
if value
is a Number
, otherwise false
.
Example
ResultisObject¶
isObject(value: Any): Boolean
Returns true
if value
is an Object
, otherwise false
.
Example
ResultisString¶
isString(value: Any): Boolean
Returns true
if value
is a String
, otherwise false
.
Example
Resultjoin¶
Array[Number] join¶
join(arr: Array[Number], separator: String): String
Returns a new String
composed of all the elements in arr
separated by the separator
.
Example
ResultArray[String] join¶
join(arr: Array[String], String): String
Returns a new String
composed of all the elements in arr
separated by the separator
.
Example
Resultkeys¶
keys(obj: Object): Array[String]
Returns an Array[String]
containing all the keys in obj
.
Example
Resultlength¶
Array length¶
length(arr: Array): Number
Returns the size of arr
.
Example
ResultFunc length¶
length(func: Function): Number
Returns the number of func
parameters.
Example
ResultObject length¶
length(obj: Object): Number
Returns the number of entries in obj
.
Example
ResultString length¶
length(str: String): Number
Returns the number of characters in str
.
Example
Resultmap¶
map func(value)¶
map(arr: Array[A], function: Func[(A) => B]): Array[B]
Returns a new Array[B]
with the results of applying function
to all elements in arr
. function
must accept an A
.
Example
Resultmap func(value, idx)¶
map(arr: Array[A], function: Func[(A, Number) => B]): Array[B]
Returns a new Array[B]
with the results of applying function
to all elements in arr
. function
must accept an A
and its Number
index.
Example
ResultmapEntries¶
mapEntries func(value)¶
mapEntries(obj: Object[A], function: Func[(Object[A]) => B]): Array[B]
Returns an Array[B]
with the results of applying function
to all entries in obj
. function
must accept an A
.
Example
local languages = {
scala: { version: '3.1.3', isJvm: true, project: 'scala-lang.org' },
java: { version: '19', isJvm: true, project: 'jdk.java.net' },
python: { version: '3.10.4', isJvm: false, project: 'python.org' }
};
xtr.mapEntries(languages, function(lang) lang.project)
mapEntries func(value, key)¶
mapEntries(obj: Object[A], function: Func[(Object[A], String) => B]): Array[B]
Returns an Array[B]
with the results of applying function
to all entries in obj
. function
must accept an A
and its corresponding String
key.
Example
local languages = {
scala: { version: '3.1.3', isJvm: true, project: 'scala-lang.org' },
java: { version: '19', isJvm: true, project: 'jdk.java.net' }
};
xtr.mapEntries(languages, function(lang, name) {
name: name,
version: lang.version
})
mapEntries func(value, key, idx)¶
mapEntries(obj: Object[A], function: Func[(Object[A], String, Number) => B]): Array[B]
Returns an Array[B]
with the results of applying function
to all entries in obj
. function
must accept an A
and its corresponding String
key and Number
index.
Example
local languages = {
scala: { version: '3.1.3', isJvm: true, project: 'scala-lang.org' },
java: { version: '19', isJvm: true, project: 'jdk.java.net' }
};
local langFunc(lang, name, idx) = {
name: name,
[if idx == 0 then 'preferred']: true
};
xtr.mapEntries(languages, langFunc)
mapObject¶
mapObject func(value)¶
mapObject(obj: Object[A], function: Func[(A) => Object[B]]): Object[B]
Returns a new Object[B] containing the entry of every Object[B] obtained by applying the given function
to all entries in obj. function
must accept an A
value.
mapObject func(value, key)¶
mapObject(obj: Object[A], function: Func[(A, String) => Object[B]]): Object[B]
Returns a new Object[B] containing the entry of every Object[B] obtained by applying the given function
to all entries in obj. function
must accept an A
value and its corresponding String
key.
mapObject func(value, key, idx)¶
mapObject(obj: Object[A], function: Func[(A, String, Number) => Object[B]]): Object[B]
Returns a new Object[B] containing the entry of every Object[B] obtained by applying the given function
to all entries in obj. function
must accept an A
value and its corresponding String
key and Number
index.
max¶
Array[Boolean] max¶
max(arr: Array[Boolean]): Boolean
Returns the max Boolean
in arr
, with true
being "bigger" than false
.
Example
ResultArray[Number] max¶
max(arr: Array[Number]): Number
Returns the max Number
in arr
.
Example
ResultArray[String] max¶
max(arr: Array[String]): String
Returns the max String
in arr
.
Example
ResultmaxBy¶
maxBy func(_) => Boolean¶
maxBy(arr: Array[A], function: Func[(A) => Boolean]): Array[A]
Returns the max A
by comparing the values returned by function
, which must accept an A
.
Example
local languages = [
{ name: 'java', version: '19', isPreferred: false },
{ name: 'python', version: '3.1.14', isPreferred: false }
{ name: 'scala', version: '3.1.3', isPreferred: true },
];
xtr.maxBy(languages, function(lang) lang.isPreferred)
maxBy func(_) => Number¶
maxBy(arr: Array[A], function: Func[(A) => Number]): Array[A]
Returns the max A
by comparing the values returned by function
, which must accept an A
.
Example
local languages = [
{ name: 'java', version: '19', weight: 2 },
{ name: 'python', version: '3.1.14', weight: 2 }
{ name: 'scala', version: '3.1.3', weight: 4 },
];
xtr.maxBy(languages, function(lang) lang.weight)
maxBy func(_) => String¶
maxBy(arr: Array[A], function: Func[(A) => String]): Array[A]
Returns the max A
by comparing the values returned by function
, which must accept an A
.
Example
local languages = [
{ name: 'java', version: '19', score: 'B' },
{ name: 'python', version: '3.1.14', score: 'B' },
{ name: 'scala', version: '3.1.3', score: 'S' }
];
xtr.maxBy(languages, function(lang) lang.score)
min¶
Array[Boolean] min¶
min(arr: Array[Boolean]): Boolean
Returns the min Boolean
in arr
, with false
being "smaller" than true
.
Example
ResultArray[Number] min¶
min(arr: Array[Number]): Number
Returns the min Number
in arr
.
Example
ResultArray[String] min¶
min(arr: Array[String]): String
Returns the min String
in arr
.
Example
ResultminBy¶
minBy func(_) => Boolean¶
minBy(arr: Array[A], comparator: Func[(A) => Boolean]): Array[A]
Returns the min A
by comparing the values returned by function
, which must accept an A
.
Example
local languages = [
{ name: 'java', version: '19', isPreferred: false },
{ name: 'python', version: '3.1.14', isPreferred: false },
{ name: 'scala', version: '3.1.3', isPreferred: true }
];
xtr.minBy(languages, function(lang) lang.isPreferred)
minBy func(_) => Number¶
minBy(arr: Array[A], comparator: Func[(A) => Number]): Array[A]
Returns the min A
by comparing the values returned by function
, which must accept an A
.
Example
local languages = [
{ name: 'java', version: '19', weight: 2 },
{ name: 'python', version: '3.1.14', weight: 2 },
{ name: 'scala', version: '3.1.3', weight: 4 }
];
xtr.minBy(languages, function(lang) lang.weight)
minBy func(_) => String¶
minBy(arr: Array[A], comparator: Func[(A) => String]): Array[A]
Returns the min A
by comparing the values returned by function
, which must accept an A
.
Example
local languages = [
{ name: 'java', version: '19', score: 'B' },
{ name: 'python', version: '3.1.14', score: 'B' },
{ name: 'scala', version: '3.1.3', score: 'S' }
];
xtr.minBy(languages, function(lang) lang.score)
parseNum¶
parseNum(str: String): Number
Returns the Number
representation of the given str
.
Example
ResultsortBy¶
sortBy func(_) => Boolean¶
sortBy(arr: Array[A], Func[(A) => Boolean]): Array[A]
Returns a new Array[A]
with the conents of arr
sorted by comparing the values returned by function
, which must accept and A
.
Example
local languages = [
{ name: 'java', version: '19', isPreferred: false },
{ name: 'scala', version: '3.1.3', isPreferred: true },
{ name: 'python', version: '3.1.14', isPreferred: false }
];
xtr.minBy(languages, function(lang) lang.isPreferred)
[
{ name: 'java', version: '19', isPreferred: false },
{ name: 'python', version: '3.1.14', isPreferred: false },
{ name: 'scala', version: '3.1.3', isPreferred: true }
]
sortBy func(_) => Number¶
sortBy(arr: Array[A], Func[(A) => Number]): Array[A]
Returns a new Array[A]
with the conents of arr
sorted by comparing the values returned by function
, which must accept and A
.
Example
local languages = [
{ name: 'java', version: '19', weight: 3 },
{ name: 'scala', version: '3.1.3', weight: 4 },
{ name: 'python', version: '3.1.14', weight: 2 }
];
xtr.sortBy(languages, function(lang) lang.weight)
[
{ name: 'python', version: '3.1.14', weight: 2 },
{ name: 'java', version: '19', weight: 3 },
{ name: 'scala', version: '3.1.3', weight: 4 }
]
sortBy func(_) => String¶
sortBy(arr: Array[A], Func[(A) => String]): Array[A]
Returns a new Array[A]
with the conents of arr
sorted by comparing the values returned by function
, which must accept and A
.
Example
local languages = [
{ name: 'java', version: '19', score: 'B' },
{ name: 'scala', version: '3.1.3', score: 'S' },
{ name: 'python', version: '3.1.14', score: 'B' }
];
xtr.sortBy(languages, function(lang) lang.score)
[
{ name: 'java', version: '19', score: 'B' },
{ name: 'python', version: '3.1.14', score: 'B' },
{ name: 'scala', version: '3.1.3', score: 'S' }
]
range¶
range(first: Number, last: Number): Array[Number]
Returns an Array[Number]
containing numbers from first
to last
.
Example
Resultread¶
read mediaType¶
read(data: String, mediaType: String): Any
Parses the data
as the given mediaType
using the data format plugins available to the Transformer
.
Example
Resultread mediaType, params¶
read(data: String, mediaType: String, params: Object): Any
Parses the data
as the given mediaType
and params
options using the data format plugins available to the Transformer
.
Example
ResultreadUrl¶
readUrl mediaType¶
readUrl(url: String, mediaType: String): Any
Retrieves the data at url
and parses it as the given mediaType
. Supported schemes/protocols are http
, https
, classpath
, and file
.
Asumming example.com
returns <hello>world!</hello>
:
Example
ResultreadUrl mediaType, params¶
readUrl(url: String, mediaType: String, params: Object): Any
Retrieves the data at url
and parses it as the given mediaType
with params
options. Supported schemes/protocols are http
, https
, classpath
, and file
.
Asumming example.com
returns <hello>world!</hello>
:
Example
ResultrmKey¶
rmKey(obj: Object[A], key: String): Object[A]
Returns a new Object[A]
containing the entries of obj
minus the entry for the given key
.
Example
ResultrmKeyIn¶
rmKeyIn(obj: Object[A], arr: Array[String]): Object[A]
Returns a new Object[A]
containing the entries of obj
minus the entries whose key is in the given arr
.
Example
Resultreplace¶
replace(str1: String, str2: String, str3: String): String
Returns a new String
with the contents of str1
, with occurrences of str2
replaced by str3
.
Example
Resultreverse¶
Array reverse¶
reverse(arr: Array): Array
Returns a new Array
with the elements of arr
in reversed order.
Example
ResultObject reverse¶
reverse(obj: Object): Object
Returns a new Object
with the entries of obj
in reversed order.
Example
ResultString reverse¶
reverse(str: String): String
Returns a new String
with the characters of str
in reversed order.
Example
Resultsplit¶
split(str1: String, str2: String): Array[String]
Returns an Array[String]
containing the chunks of str1
split by the contents of str2
.
Example
ResultstartsWith¶
startsWith(str1: String, str2: String): Boolean
Returns true
if str1
starts with str2
.
Example
ResulttoLowerCase¶
toLowerCase(str: String): String
Returns the lowercase representation of str
.
Example
ResulttoString¶
toString(value: String|Number|Boolean|Null): String
Returns the String
representation of value
.
Example
ResulttoUpperCase¶
toUpperCase(String): String
Returns the uppercase representation of str
.
Example
Resulttrim¶
trim(str: String): String
Returns a new String
with the contents of str
removed of leading and trailing whitespaces.
Example
Resulttype¶
type(value: Any): String
Returns the String
name of the type of value
.
Example
local func(it) = it;
{
bool: xtr.type(true),
num: xtr.type(365),
nil: xtr.type(null),
arr: xtr.type([]),
obj: xtr.type({}),
func: xtr.type(func)
}
uuid¶
uuid(): String
Generates a new random UUID v4 String
.
Example
Resultvalues¶
values(obj: Object[A]): Array[A]
Returns an Array[String]
containing all the values in obj
.
Example
Resultwrite¶
write mediaType¶
write(data: Any, mediaType: String): String
Writes the data
in the given mediaType
format using the data format plugins available to the Transformer
.
Example
Resultwrite mediaType, params¶
write(data: Any, mediaType: String, params: Object[): String
Writes the data
in the given mediaType
format and params
options using the data format plugins available to the Transformer
.
Example
Result