utils

Namespace

utils

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

Source:

Members

(static) OPENHAB_JS_VERSION :string

Description:
  • openHAB JavaScript library version

Source:

openHAB JavaScript library version

Type:
  • string

Methods

(static) dumpObject(obj, dumpPropsopt)

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

Source:
Parameters:
Name Type Attributes Default Description
obj *

object

dumpProps boolean <optional>
false

whether properties also should be dumped

(static) javaListToJsArray(list) → {Array}

Description:
  • Convert Java List to JavaScript Array.

Source:
Parameters:
Name Type Description
list JavaList
Returns:

JavaScript Array

Type
Array

(static) javaMapToJsMap(map) → {Map:.<any:, any:>}

Description:
  • Convert Java Map to JavaScript Map.

Source:
Parameters:
Name Type Description
map JavaMap
Returns:

JavaScript Map

Type
Map:.<any:, any:>

(static) javaMapToJsObj(map) → {object}

Description:
  • Convert Java Map to JavaScript Object.

Source:
Parameters:
Name Type Description
map JavaMap
Returns:

JavaScript Object

Type
object

(static) javaSetToJsArray(set) → {Array}

Description:
  • Convert Java Set to JavaScript Array.

Source:
Parameters:
Name Type Description
set JavaSet
Returns:

JavaScript Array

Type
Array

(static) javaSetToJsSet(set) → {Set}

Description:
  • Convert Java Set to JavaScript Set.

Source:
Parameters:
Name Type Description
set JavaSet

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

Returns:
Type
Set

(static) jsArrayToJavaList(arr) → {JavaList}

Description:
  • Convert JavaScript Array to Java List.

Source:
Parameters:
Name Type Description
arr Array

JavaScript Array

Returns:
Type
JavaList

(static) jsArrayToJavaSet(arr) → {JavaSet}

Description:
  • Convert JavaScript Array to Java Set.

Source:
Parameters:
Name Type Description
arr Array
Returns:

Java Set

Type
JavaSet

(static) jsSetToJavaSet(set) → {JavaSet}

Description:
  • Convert JavaScript Set to Java Set.

Source:
Parameters:
Name Type Description
set Set

JavaScript Set

Returns:

Java Set

Type
JavaSet

(static) randomUUID() → {string}

Description:
  • Generate a random UUID.

Source:
Returns:

random UUID

Type
string