new JsonEvent()
- Source:
Methods
arrayValue() → {Array}
- Source:
Returns:
the JSON array value or
null if the event has no JSON value
- Type
- Array
binaryValue() → {Buffer}
Return the binary value.
JSON itself has no notion of a binary, this extension complies to the RFC-7493, so this method assumes there is a String value with the key and it contains a Base64 encoded binary, which it decodes if found and returns.
- Source:
Returns:
the binary value or
null if the event has no JSON value
- Type
- Buffer
booleanValue() → {boolean}
- Source:
Returns:
the
Boolean value or null if the event has no JSON value
- Type
- boolean
doubleValue() → {number}
- Source:
Returns:
the
Double value or null if the event has no JSON value
- Type
- number
fieldName() → {string}
- Source:
Returns:
the name of the field when the event is emitted as a JSON object member
- Type
- string
floatValue() → {number}
- Source:
Returns:
the
Float value or null if the event has no JSON value
- Type
- number
integerValue() → {number}
- Source:
Returns:
the
Integer value or null if the event has no JSON value
- Type
- number
isArray() → {boolean}
- Source:
Returns:
true when the JSON value is a JSON array
- Type
- boolean
isBoolean() → {boolean}
- Source:
Returns:
true when the JSON value is a boolean
- Type
- boolean
isNull() → {boolean}
- Source:
Returns:
true when the JSON value is null
- Type
- boolean
isNumber() → {boolean}
- Source:
Returns:
true when the JSON value is a number
- Type
- boolean
isObject() → {boolean}
- Source:
Returns:
true when the JSON value is a JSON object
- Type
- boolean
isString() → {boolean}
- Source:
Returns:
true when the JSON value is a string
- Type
- boolean
longValue() → {number}
- Source:
Returns:
the
Long value or null if the event has no JSON value
- Type
- number
mapTo(type) → {Object}
Decodes and returns the current value as the specified
type.
Parameters:
| Name | Type | Description |
|---|---|---|
type |
todo | the type to decode the value to |
- Source:
Returns:
the decoded value
- Type
- Object
objectValue() → {Object}
- Source:
Returns:
the JSON object value or
null if the event has no JSON value
- Type
- Object
stringValue() → {string}
- Source:
Returns:
the string value or
null if the event has no JSON value
- Type
- string
type() → {Object}
- Source:
Returns:
the type of the event
- Type
- Object
value() → {Object}
- Source:
Returns:
the json value for events
- Type
- Object