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()
Get the type of the value for this key.JsTypegetElementValueType(stringkey)
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()
Check whether the value for this key is null.boolisNull(stringkey)
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()
Check whether the value for this key is undefined.boolisUndefined(stringkey)
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()
Get the string value (in UTF-8 encoding) for this key.stringgetString(stringkey)
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()
Get the boolean value for this key.boolgetBool(stringkey)
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()
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.doublegetDouble(stringkey)
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()
Get the signed 64-bit value for this key. Guaranteed to return an integer value that is, within the following bounds:i64getInt(stringkey)
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()
Get the IJsArray value for this key.IJsArray*getArray(stringkey)
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()
Get the IJsObject value for this key.IJsObject*getObject(stringkey)
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.

