# Class: Utilities

## jala.Utilities()

This class contains various convenience methods which do not fit in any other class.

## Constructor

#### new Utilities()

Construct a utility object.

Source:
  - jala/code/Utilities.js, line 45

##### Returns:

A new utitilty object.

### Members

#### (static, readonly) VALUE_ADDED :Number

Static field indicating ad added object property.

##### Type:

- Number

Source:
  - jala/code/Utilities.js, line 145

#### (static, readonly) VALUE_MODIFIED :Number

Static field indicating a modified object property.

##### Type:

- Number

Source:
  - jala/code/Utilities.js, line 152

#### (static, readonly) VALUE_REMOVED :Number

Static field indicating a removed object property.

##### Type:

- Number

Source:
  - jala/code/Utilities.js, line 138

### Methods

#### createPassword(len, level)

Creates a random password with different levels of security.

##### Parameters:

Name | Type | Description
--- | --- | ---
`len` | Number | The length of the password (default: 8)

`level`

Number

The security level

- 0 - containing only vowels or consonants (default)
- 1 - throws in a number at random position
- 2 - throws in a number and a special character at random position

Source:
  - jala/code/Utilities.js, line 86

##### Returns:

The resulting password

#### diffObjects(obj1, obj2)

Returns an array containing the properties that are added, removed or modified in one object compared to another.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj1` | Object | The first of two objects which should be compared
`obj2` | Object | The second of two objects which should be compared

Source:
  - jala/code/Utilities.js, line 166

##### Returns:

An Object containing all properties that are added, removed or modified in the second object compared to the first. Each property contains a status field with an integer value which can be checked against the static jala.Utility fields VALUE_ADDED, VALUE_MODIFIED and VALUE_REMOVED.

#### patchObject(obj, diff)

Patches an object with a "diff" object created by the #diffObjects method. Please mind that this method is recursive, it descends along the "diff" object structure.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | Object | The Object the diff should be applied to
`diff` | Object | A "diff" object created by the #diffObjects method

Source:
  - jala/code/Utilities.js, line 222

##### Returns:

The patched Object with all differences applied

#### toString()

Return a string representation of the utitility object.

Source:
  - jala/code/Utilities.js, line 63

##### Returns:

[jala.Utilities Object]

#### (static) toString()

Return a string representation of the utitility class.

Source:
  - jala/code/Utilities.js, line 54

##### Returns:

[jala.Utilities]