Class: eFTLMessage

eFTLMessage

new eFTLMessage()

Message objects contain typed fields that map names to values.

Methods

get(fieldName) → {object}

Get the value of a field from a message.
Parameters:
Name Type Description
fieldName string Get this field.
Returns:
The value of the field, if the field is present; undefined otherwise.
Type
object

getDeliveryCount() → {number}

Get the message's delivery count assigned by the persistence service.
Returns:
The message delivery count.
Type
number

getFieldNames() → {Array.<String>}

Get the names of all fields present in the message.
Returns:
An array of of field names.
Type
Array.<String>

getStoreMessageId() → {number}

Get the message's unique store identifier assigned by the persistence service.
Returns:
The message identifier.
Type
number

set(fieldName, value)

Set a field in a message.

Note: This method can set values of the following types:

  • String
  • Number
  • Date
  • eFTLMessage
  • Array of String (null/undefined is not a legal value within this array.)
  • Array of Number
  • Array of Date
  • Array of eFTLMessage

The method marks the field with the corresponding field type.

To set a value and mark the field with a different field type, use the following methods:

Parameters:
Name Type Description
fieldName string Set this field
value object Set this value. To remove the field, supply null.
Throws:
TypeError if the value provided doesn't not match a supported type.

setAsDouble(fieldName, value)

Set a field in the message, marking the field as double.
Parameters:
Name Type Description
fieldName string Set this field
value number Set this value. To remove, supply null.
Throws:
TypeError if the value provided is not a Number or an array of Number.

setAsLong(fieldName, value)

Set a field in a message, marking the field as long.
Parameters:
Name Type Description
fieldName string Set this field
value number Set this value. To remove, supply null.
Throws:
TypeError if the value provided doesn't not match a Number or an array of Number.

setAsOpaque(fieldName, value)

Set a field in a message, marking the field as opaque.
Parameters:
Name Type Description
fieldName string Set this field
value string Set this value. To remove, supply null.

toString() → {string}

Returns a string representing the message.
Returns:
A string representing the message.
Type
string