Convert
Application data type converter.
arrayToList
_convert.arrayToList(array: java.lang.Object) : java.util.List
Description
Converts an array of primitive types to a list (collection).
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
array | java.lang.Object | Array that will be converted into a list (collection). |
Return
( java.util.List )
New list with all array elements.
bytesFromText
_convert.bytesFromText(text: string) : byte[]
Description
Converts a text to byte array.
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
text | string | Text content. |
Return
( byte[] )
Returns the byte array obtained from text.
_convert.bytesFromText(text: string, charset: string) : byte[]
Description
Converts a text to byte array.
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
text | string | Text content. |
charset | string | Character encoding code. |
Return
( byte[] )
Returns the byte array obtained from text.
fromBase64
_convert.fromBase64(content: byte[]) : string
Description
Converts Base64 content to a decoded string.
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
content | byte[] | Content to be converted. |
Return
( string )
Returns the decoded string that was in Base64.
_convert.fromBase64(content: string) : string
Description
Converts Base64 content to a decoded string.
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
content | string | Content to be converted. |
Return
( string )
Returns the decoded string that was in Base64.
fromBase64AsBytes
_convert.fromBase64AsBytes(content: byte[]) : byte[]
Description
Converts the Base64 content to the original decoded byte array.
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
content | byte[] | Content to be converted. |
Return
( byte[] )
Returns decoded bytes that were in Base64.
_convert.fromBase64AsBytes(content: string) : byte[]
Description
Converts the Base64 content to the original decoded byte array.
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
content | string | Content to be converted. |
Return
( byte[] )
Returns decoded bytes that were in Base64.
fromHTML
_convert.fromHTML(content: string) : string
Description
Transforms the encoding of special HTML characters to plain text.
How To Use
// Will print: €s Ação
_out.print(_convert.fromHTML("€s Ação"))
Attributes
NAME | TYPE | DESCRIPTION |
---|---|---|
content | string | Content to be converted. |
Return
( string )
Text with encoding of special characters in HTML transformed to normal text.
fromJSON
_convert.fromJSON(content: string) : string
Description
Transforms the encoding of special characters from JSON to normal text.
How To Use
// Will print: €s Ação
_out.print(_convert.toJSON("\u20ACs A\u00E7\u00E3o"))