MessageEnvelope class Null safety
Allows adding additional information to messages. A correlation id, message id, and a message type are added to the data being sent/received. Additionally, a MessageEnvelope can reference a lock token.
Side note: a MessageEnvelope's message is stored as string, so strings are converted using utf8 conversions.
Constructors
- MessageEnvelope(String? correlationId, String? messageType, dynamic message)
- Creates a new MessageEnvelope, which adds a correlation id, message id, and a type to the data being sent/received.
Properties
- correlation_id ↔ String?
-
read / write
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- message ↔ String?
-
read / write
- message_id ↔ String
-
read / write
- message_type ↔ String?
-
read / write
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- sent_time ↔ DateTime?
-
read / write
Methods
-
fromJson(
String? value) → void - Converts a JSON string into a MessageEnvelop The message payload is passed as string
-
getMessageAsJson(
) → dynamic - Returns the value that was stored in this message as a JSON string.
-
getMessageAsString(
) → String - Returns the information stored in this message as a UTF-8 encoded string.
-
getReference(
) → dynamic - Returns the lock token that this MessageEnvelope references.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
setMessageAsJson(
dynamic value) → void - Stores the given value as a JSON string.
-
setMessageAsString(
String value) → void - Stores the given string.
-
setReference(
dynamic value) → void - Sets a lock token reference for this MessageEnvelope.
-
toJSON(
) → Map< String, dynamic> - Converts this MessageEnvelop to a JSON string. The message payload is passed as string Returns A JSON encoded representation is this object.
-
toString(
) → String -
Convert's this MessageEnvelope to a string, using the following format:
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJSON(
String? value) → MessageEnvelope? - Converts a JSON string into a MessageEnvelop The message payload is passed as string