SwitchboardObject
Superclass of all objects in the Switchboard SDK. Provides generic basic functionality.
The JSON shape shared by every Switchboard object instance is documented in the Object Schema.
Configuration
This object does not provide any configuration options.
Properties
hasActions (Read only)
Type: Boolean
Whether the object has any registered actions. Every object registers setProperty, so this is currently always true.
hasEvents (Read only)
Type: Boolean
Whether the object declares any events.
objectID
Type: String
The unique identifier of the object. Taken from the id or objectID configuration key when the object is created. Other objects refer to it by this ID, so changing it later does not update those references.
objectType (Read only)
Type: String
Options: switchboard, engine, graph, node, extension
The kind of the object.
Actions
getActions
Returns the schema of the actions registered on this object.
Parameters
None.
Return Value
Object — Map keyed by action name with the description, parameters and return type of each action. The built-in getState, getConfiguration, getProperties, getActions and getEvents actions are not listed.
getConfiguration
Returns the configuration parameters of this object with their schema and the value it was created with.
Parameters
None.
Return Value
Object — Map keyed by configuration name; each entry holds the schema fields and the value used for this instance.
getEvents
Returns the schema of the events this object can emit.
Parameters
None.
Return Value
Object — Map keyed by event name with the description and data fields of each event.
getProperties
Returns the properties of this object with their schema and current value.
Parameters
None.
Return Value
Object — Map keyed by property name; each entry holds the schema fields and the current value.
getState
Returns the full state of the object including identity, configuration, and current property values.
Parameters
None.
Return Value
Object — Map with objectID, objectURI (the object's ID prefixed by its parents' IDs, separated by dots), objectType, objectSubtype, a legacy id copy of objectID, configuration (the configuration values the object was created with) and properties (the current value of every property). Nodes also include type, the full node type such as Switchboard.Gain.
setProperty
Sets a property to a new value by name. Works for any writable property, so it can be the target of an event-to-action connection in a graph. Fails if the property does not exist or is read-only.
Parameters
| Name | Type | Description |
|---|---|---|
name | String | Name of the property to set. |
value | Object | New value for the property, of the property's type. |
Return Value
None.
Events
This object does not provide any events.