Class Label

Class for labels.

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

    • label: LabelAndDescription

      The label for this class in JSON format.

    Returns Label

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

Properties

language: LabelLanguages

The language of the label.

value: string

The value of the label.

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.

    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.

    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.

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