Class: default
Defined in: lib/types/Label.ts:19
Contract for types that can serialize to JSON and provide default values.
Implements
Constructors
Constructor
new default(
name,description):Label
Defined in: lib/types/Label.ts:37
Create a new Label.
Parameters
name
string = ""
The label name
description
string = ""
The label description
Returns
Label
Properties
description
description:
string
Defined in: lib/types/Label.ts:21
name
name:
string
Defined in: lib/types/Label.ts:20
Methods
clone()
clone():
Label
Defined in: lib/types/Label.ts:94
Create a deep copy of this label.
Returns
Label
A cloned Label instance.
getDefaultJSON()
getDefaultJSON():
LabelJSON
Defined in: lib/types/Label.ts:86
Get the default JSON representation for a label.
Returns
Default Label JSON values.
Implementation of
getDefaultMappedJSON()
getDefaultMappedJSON():
Defaults<LabelJSONMap>
Defined in: lib/types/Label.ts:102
Default mapped JSON shape keyed by a canonical label id.
Returns
Defaults for the label JSON map.
Implementation of
getDescription()
getDescription():
string
Defined in: lib/types/Label.ts:60
Returns
string
The label description
getName()
getName():
string
Defined in: lib/types/Label.ts:45
Returns
string
The label name
setDescription()
setDescription(
description):void
Defined in: lib/types/Label.ts:68
Update the label description.
Parameters
description
string
New label description
Returns
void
setName()
setName(
name):void
Defined in: lib/types/Label.ts:53
Update the label name.
Parameters
name
string
New label name
Returns
void
toJSON()
toJSON():
LabelJSON
Defined in: lib/types/Label.ts:75
Returns
Dictionary object that represents this label
Implementation of
toPartialMappedJSON()
toPartialMappedJSON():
Partial<LabelJSONMap>
Defined in: lib/types/Label.ts:112
Partial mapped JSON for this label keyed by a canonical label id.
Returns
Partial<LabelJSONMap>
A mapping with the current label JSON.
Implementation of
build()
staticbuild(obj):Label
Defined in: lib/types/Label.ts:28
Build a Label from its JSON representation.
Parameters
obj
JSON object to parse
Returns
Label
A new Label instance
