MqttClientPayloadBuilder class

Utility class to assist with the building of message topic payloads. Implements the builder pattern, i.e. returns itself to allow chaining.

Constructors

MqttClientPayloadBuilder()
Construction

Properties

hashCode int
The hash code for this object.
no setterinherited
length int
Length
no setter
payload → Uint8Buffer?
Payload
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addBool({required bool val}) MqttClientPayloadBuilder
Add a bool, true is 1, false is 0
addBuffer(Uint8Buffer buffer) MqttClientPayloadBuilder
Add a buffer
addByte(int val) MqttClientPayloadBuilder
Add byte, this will overflow on values > 2**8-1
addDouble(double val) MqttClientPayloadBuilder
Add a 64 bit double
addHalf(int val) MqttClientPayloadBuilder
Add a half word, 16 bits, this will overflow on values > 2**16-1
addHalfDouble(double val) MqttClientPayloadBuilder
Add a 32 bit double
addInt(int val) MqttClientPayloadBuilder
Add a long word, 64 bits or a Dart int
addProtobuf(Uint8List val) → void
addString(String val) MqttClientPayloadBuilder
Add a standard Dart string
addUTF16String(String val) MqttClientPayloadBuilder
Add a UTF16 string, note Dart natively encodes strings as UTF16
addUTF8String(String val) MqttClientPayloadBuilder
Add a UTF8 string
addWord(int val) MqttClientPayloadBuilder
Add a word, 32 bits, this will overflow on values > 2**32-1
clear() MqttClientPayloadBuilder
Clear the buffer
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited