Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IJsObject

interface IJsObject
Extends com.amazon.apmf.IStandard Immutable JavaScript Object with string keys. Each value of a key-value pair can be of any valid JavaScript dynamic type.

Methods

getAllKeys()

string[] getAllKeys()
Get all the keys present in this object.

Returns

string[] string array

getElementValueType()

JsType getElementValueType(string key)
Get the type of the value for this key.

Parameters

key
string — Required

Returns

JsType JsType

Throws

  • KeyNotFoundError — Thrown when attempting to get the value for a key, that does not exist in the object.

isNull()

bool isNull(string key)
Check whether the value for this key is null.

Parameters

key
string — Required

Returns

bool bool

Throws

  • KeyNotFoundError — Thrown when attempting to get the value for a key, that does not exist in the object.

isUndefined()

bool isUndefined(string key)
Check whether the value for this key is undefined.

Parameters

key
string — Required

Returns

bool bool

Throws

  • KeyNotFoundError — Thrown when attempting to get the value for a key, that does not exist in the object.

getString()

string getString(string key)
Get the string value (in UTF-8 encoding) for this key.

Parameters

key
string — Required

Returns

string string

Throws

  • KeyNotFoundError — Thrown when attempting to get the value for a key, that does not exist in the object.
  • JsTypeMismatchError — Thrown when attempting to get the value for some key, where the value is not of type String.

getBool()

bool getBool(string key)
Get the boolean value for this key.

Parameters

key
string — Required

Returns

bool bool

Throws

  • KeyNotFoundError — Thrown when attempting to get the value for a key, that does not exist in the object.
  • JsTypeMismatchError — Thrown when attempting to get the value for some key, where the value is not of type Bool.

getDouble()

double getDouble(string key)
Get the IEEE 754 double value for this key. JavaScript NaN is mapped to one of IEEE 754 NaNs. JavaScript +/- infinities are mapped to +/- infinities in IEEE 754.

Parameters

key
string — Required

Returns

double double

Throws

  • KeyNotFoundError — Thrown when attempting to get the value for a key, that does not exist in the object.
  • JsTypeMismatchError — Thrown when attempting to get the value for some key, where the value is not of type Double or type Int. When an Int is retrieved as a Double, the exact value is preserved, and no exception is thrown.

getInt()

i64 getInt(string key)
Get the signed 64-bit value for this key. Guaranteed to return an integer value that is, within the following bounds: Number.MIN_SAFE_INTEGER -(2**53 - 1) and Number.MAX_SAFE_INTEGER (2**53 - 1).

Parameters

key
string — Required

Returns

i64 i64

Throws

  • KeyNotFoundError — Thrown when attempting to get the value for a key, that does not exist in the object.
  • JsTypeMismatchError — Thrown when attempting to get the value for some key, where the value is not of type Int or type Double. When a Double is retrieved as an Int, the value is got after a loss in precision. However, no exception is thrown.

getArray()

IJsArray* getArray(string key)
Get the IJsArray value for this key.

Parameters

key
string — Required

Returns

IJsArray* IJsArray

Throws

  • KeyNotFoundError — Thrown when attempting to get the value for a key, that does not exist in the object.
  • JsTypeMismatchError — Thrown when attempting to get the value for some key, where the value is not of type Array.

getObject()

IJsObject* getObject(string key)
Get the IJsObject value for this key.

Parameters

key
string — Required

Returns

IJsObject* IJsObject

Throws

  • KeyNotFoundError — Thrown when attempting to get the value for a key, that does not exist in the object.
  • JsTypeMismatchError — Thrown when attempting to get the value for some key, where the value is not of type Object.

Last modified on October 29, 2026