Class

Contact

Contact()

Contact information record for a user.

Constructor

# new Contact()

View Source infohub/User.js, line 19

Extends

Classes

Contact

Members

# id

Global unique ID

Overrides:

View Source gom/cnObject.js, line 107

# shortid

Node ID / Short ID

Overrides:

View Source gom/cnObject.js, line 112

Methods

# dump() → {void}

Print current object to console.

Overrides:

View Source gom/cnObject.js, line 88

void

# get(key, defaultValueopt) → {*}

Retrieves a top-level member of the internal #_data object by key.

Common keys include: "info", "properties", "geometry", etc.

Parameters:
Name Type Attributes Default Description
key string

The name of the member to retrieve.

defaultValue * <optional>
{}

Value returned if the key does not exist.

Overrides:

View Source gom/cnObject.js, line 175

The value of the specified member, or the defaultValue if missing.

*

# getAsJson(members) → {object}

Get object as JSON in COLNEO Generic Object Model format (cnGOM).

Parameters:
Name Type Default Description
members Array | null null

Take only members into account, if null use all members.
Example: o.getAsJson( [ 'info' , 'properties' ] )

Overrides:

View Source gom/cnObject.js, line 64

Object as JSON in GOM format (Generic Object Model)

object

# getId() → {string|null}

Get ID

Since:
  • 1.0, 09.2025, jh
Overrides:

View Source gom/cnObject.js, line 129

Object ID, null if object is empty

string | null

# getName()

Get 'info.object_name'

Overrides:

View Source gom/cnObject.js, line 152

info.object_name

# getPropertyValue(typeid, defaultValueopt) → {*}

Retrieves the value of a property from the internal json object.

Parameters:
Name Type Attributes Default Description
typeid string

The property key to retrieve.

defaultValue * <optional>
null

A fallback value returned if the property does not exist.

Overrides:

View Source gom/cnObject.js, line 189

The property value if found, otherwise the defaultValue.

*

# getShortId() → {string|null}

Retrieves the short object ID from the internal json object.

Since:
  • 1.0, 09.2025, jh
Overrides:

View Source gom/cnObject.js, line 142

The short ID if available, otherwise null.

string | null

# setFromJSON(contactopt) → {void}

Fill an existing contact with new data.

Parameters:
Name Type Attributes Default Description
contact Contact <optional>
{}

The contact data to update with

View Source infohub/User.js, line 31

void

# setFromJson(obj_as_data, members)

Set object from JSON in COLNEO Generic Object Model (GOM) format.

Parameters:
Name Type Description
obj_as_data object
members Array | null

Take only members into account, if null use all members.

Overrides:

View Source gom/cnObject.js, line 40

# setName(n)

Set info.object_name

Parameters:
Name Type Description
n string

Set object_name to n

Overrides:

View Source gom/cnObject.js, line 162

# setPropertyValue(typeid, value)

Set the property value to this object.
Value is not syncronised with infohub.

Parameters:
Name Type Description
typeid string
value any
Overrides:

View Source gom/cnObject.js, line 216

# toJSON() → {object}

Convert the contact info to a plain object.

View Source infohub/User.js, line 52

Plain object representation of the contact

object

# static createFromJSON(contactopt) → {Contact}

Create a new contact from saved data.

Parameters:
Name Type Attributes Default Description
contact Contact <optional>
{}

The contact data to create from

See:
  • Contact - See Contact class for all available properties

View Source infohub/User.js, line 44

A new Contact instance

Contact