Class Alias

Class for aliases.

Constructors

Properties

Accessors

Methods

Constructors

  • Constructor for Alias.

    Parameters

    • alias: LabelAndDescription

      The alias in JSON format.

    Returns Alias

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

Properties

language: LabelLanguages

The language of the alias.

value: string

The value of the alias.

Accessors

  • get internalID(): string
  • Create a unique ID for the Alias.

    Returns string

    The ID.

Methods

  • Check if two Aliases are equal.

    Parameters

    • other: LabelAndDescription

      The other alias.

    Returns boolean

    True if the aliases are equal.

    const alias1 = new Alias({ language: 'en', value: 'foo' });
    const alias2 = new Alias({ language: 'en', value: 'bar' });

    alias1.equals(alias2); // false
  • Convert the alias to a JSON format.

    Returns LabelAndDescription

    The alias in JSON format.

    const json = alias.toJSON();
    
  • Create an Alias from a language and a value.

    Parameters

    • language: LabelLanguages

      The language of the Alias.

    • value: string

      The value of the Alias.

    Returns Alias

    The Alias object.

    const alias = Alias.fromString('en', 'Douglas Adams');