Class: EnumItem

EnumItem(typeId)

Class representing an item of Ignite enum type.

The item is defined by:

  • type Id (mandatory) - Id of the Ignite enum type.
  • ordinal (optional) - ordinal of the item in the Ignite enum type.
  • name (optional) - name of the item (field name in the Ignite enum type).
  • value (optional) - value of the item. Usually, at least one from the optional ordinal, name or value must be specified in order to use an instance of this class in Ignite operations.

To distinguish one item from another, the Ignite client analyzes the optional fields in the following order: ordinal, name, value.

Constructor

new EnumItem(typeId)

Public constructor.

Parameters:
Name Type Description
typeId number

Id of the Ignite enum type.

Source:

Methods

getName() → {string}

Returns name of the item or null if name is not set.

Source:
Returns:
  • name of the item.
Type
string

getOrdinal() → {number}

Returns ordinal of the item in the Ignite enum type or null if ordinal is not set.

Source:
Returns:
  • ordinal of the item in the Ignite enum type.
Type
number

getTypeId() → {number}

Returns Id of the Ignite enum type.

Source:
Returns:
  • Id of the enum type.
Type
number

getValue() → {number}

Returns value of the item or null if value is not set.

Source:
Returns:
  • value of the item.
Type
number

setName(name) → {EnumItem}

Sets or updates name of the item.

Parameters:
Name Type Description
name string

name of the item.

Source:
Throws:

if error.

Type
IgniteClientError
Returns:
  • the same instance of EnumItem
Type
EnumItem

setOrdinal(ordinal) → {EnumItem}

Sets or updates ordinal of the item in the Ignite enum type.

Parameters:
Name Type Description
ordinal number

ordinal of the item in the Ignite enum type.

Source:
Throws:

if error.

Type
IgniteClientError
Returns:
  • the same instance of EnumItem
Type
EnumItem

setTypeId(typeId) → {EnumItem}

Updates Id of the Ignite enum type.

Parameters:
Name Type Description
typeId number

new Id of the Ignite enum type.

Source:
Throws:

if error.

Type
IgniteClientError
Returns:
  • the same instance of EnumItem
Type
EnumItem

setValue(value) → {EnumItem}

Sets or updates value of the item.

Parameters:
Name Type Description
value number

value of the item.

Source:
Throws:

if error.

Type
IgniteClientError
Returns:
  • the same instance of EnumItem
Type
EnumItem