Class Label

class for labels

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

    • label: LabelAndDescription

      the label for this class in json format

    Returns Label

    Example

    const label = new Label({ language: 'en', value: 'Douglas Adams' });
    

Properties

language: LabelLanguages

the language of the description

value: string

the value of the description

Accessors

  • get internalID(): string
  • create a unique id for the Label

    Returns string

    the id

Methods

  • this function checks if two Labels are equal

    Parameters

    • other: LabelAndDescription

      the other Label

    Returns boolean

    true if the Labels are equal

    Example

    const label1 = new Label({ language: 'en', value: 'foo' });
    const label2 = new Label({ language: 'en', value: 'bar' });

    label1.equals(label2); // false
  • Returns LabelAndDescription

    the label as json

    Example

    const json = label.toJson();
    
  • create a label from a language and a value

    Parameters

    • language: LabelLanguages

      the language of the label

    • value: string

      the value of the label

    Returns Label

    the label object

    Example

    const label = Label.fromString('en', 'Douglas Adams')
    

Generated using TypeDoc