Class Description

Class for descriptions.

Constructors

Properties

Accessors

Methods

Constructors

  • Constructor for the Description class.

    Parameters

    • label: LabelAndDescription

      The label in JSON format.

    Returns Description

    const description = new Description({ 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 Description.

    Returns string

    The ID.

Methods

  • Check if two descriptions are equal.

    Parameters

    • other: LabelAndDescription

      The other label.

    Returns boolean

    True if the descriptions are equal.

    const description1 = new Description({ language: 'en', value: 'foo' });
    const description2 = new Description({ language: 'en', value: 'bar' });

    description1.equals(description2); // false
  • Convert the Description to a JSON format.

    Returns LabelAndDescription

    The Description in JSON format.

    const json = description.toJSON();
    
  • Create a Description from a language and a value.

    Parameters

    • language: LabelLanguages

      The language of the Description.

    • value: string

      The value of the Description.

    Returns Description

    The Description object.

    const description = Description.fromString('en', 'Douglas Adams');