utils

utils

Source:

Utils namespace. This namespace handles utilities, especially for conversion from and to Java data types.

Methods

(static) jsSetToJavaSet(set) → {java.util.Set}

Source:

Convert JavaScript Set to Java Set.

Parameters:
Name Type Description
set Set

JavaScript Set Object (https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Set)

Returns:
Type
java.util.Set

(static) jsArrayToJavaSet(arr) → {java.util.Set}

Source:

Convert JavaScript Array to Java Set.

Parameters:
Name Type Description
arr Array

JavaScript Array

Returns:
Type
java.util.Set

(static) jsArrayToJavaList(arr) → {java.util.List}

Source:

Convert JavaScript Array to Java List.

Parameters:
Name Type Description
arr Array

JavaScript Array

Returns:
Type
java.util.List

(static) javaListToJsArray(set) → {Array}

Source:

Convert Java List to JavaScript Array.

Parameters:
Name Type Description
set java.util.List

Java Set (https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html)

Returns:

JavaScript Array

Type
Array

(static) javaSetToJsArray(set) → {Array}

Source:

Convert Java Set to JavaScript Array.

Parameters:
Name Type Description
set java.util.Set

Java Set (https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Set.html)

Returns:

JavaScript Array

Type
Array

(static) javaSetToJsSet(set) → {Set}

Source:

Convert Java Set to JavaScript Set.

Parameters:
Name Type Description
set java.util.Set

Java Set (https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Set.html)

Returns:
Type
Set

(static) randomUUID() → {string}

Source:

Generate a random UUID.

Returns:

random UUID

Type
string

(static) dumpObject(obj, dumpPropsopt)

Source:

Outputs all members and properties of an object and whether it is a JS or a Java Object to the log.

Parameters:
Name Type Attributes Default Description
obj *

object

dumpProps boolean <optional>
false

whether properties also should be dumped

(static) isJsInstanceOfJava(instance, type) → {boolean}

Source:

Checks whether an object is instance of a Java class.

Parameters:
Name Type Description
instance *

object

type java.lang.Class

Java class (https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html)

Throws:

error if type is not a java class

Returns:

whether it is an instance of a Java class

Type
boolean