toString method

  1. @override
String toString()
override

A string representation of this object.

Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.

Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.

Implementation

@override
String toString() {
  final sb = StringBuffer();
  sb.writeln('Session Present = ${connectAckFlags.sessionPresent}');
  sb.writeln(
      'Connect Reason Code = ${mqttConnectReasonCode.asString(reasonCode)}');
  sb.writeln('Session Expiry Interval = $sessionExpiryInterval');
  sb.writeln('Receive Maximum = $receiveMaximum');
  sb.writeln('Maximum QoS = $maximumQos');
  sb.writeln('Retain Available = $retainAvailable');
  sb.writeln('Maximum Packet Size = $maximumPacketSize');
  sb.writeln('Assigned client Identifier = $assignedClientIdentifier');
  sb.writeln('Topic Alias Maximum = $topicAliasMaximum');
  sb.writeln('Reason String = $reasonString');
  sb.writeln(
      'Wildcard Subscription Available = $wildcardSubscriptionsAvailable');
  sb.writeln(
      'Subscription Identifiers Available = $subscriptionIdentifiersAvailable');
  sb.writeln('Shared Subscription Available = $sharedSubscriptionAvailable');
  sb.writeln('broker Keep Alive = $serverKeepAlive');
  sb.writeln('Response Information = $responseInformation');
  sb.writeln('broker Reference = $serverReference');
  sb.writeln('Authentication Method = $authenticationMethod');
  sb.writeln('Properties = ${_propertySet.toString()}');
  return sb.toString();
}