Class: ExtensibleData

ExtensibleData


new ExtensibleData( [json])

A set of data that supports extension elements.
Parameters:
Name Type Argument Description
json Object <optional>

Extends

Methods


addField(field)

Add a field
Parameters:
Name Type Description
field Field
Returns:
this
Type
ExtensibleData

Add a link
Parameters:
Name Type Description
link Link
Returns:
this
Type
ExtensibleData

getFields()

Get the fields
Returns:
Type
Array.<Field>

getId()

Get the object's id.
Returns:
Id
Type
String

Get a link
Parameters:
Name Type Description
rel String
Returns:
Type
Link

Get the links
Returns:
Type
Array.<Link>

init(json)

Initialize from JSON
Parameters:
Name Type Description
json Object
Overrides:
Returns:
this
Type
ExtensibleData

<static> isInstance(obj)

Check whether the given object is an instance of this class.
Parameters:
Name Type Description
obj Object
Returns:
Type
Boolean

setFields(fields)

Set the fields
Parameters:
Name Type Description
fields Array.<Field>
Returns:
this
Type
ExtensibleData

setId(id)

Set the object's id.
Parameters:
Name Type Description
id String
Returns:
This object, for chaining.
Type
ExtensibleData

Set the links
Parameters:
Name Type Description
links Links
Returns:
this
Type
ExtensibleData

toJSON()

Export the object as JSON
Overrides:
Returns:
JSON object
Type
Object