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 $contents = [
    if (enableIpv4 != null) 'enableIpv4=$enableIpv4',
    if (enableIpv6 != null) 'enableIpv6=$enableIpv6',
    if (ipAddress != null) 'ipAddress=$ipAddress',
    if (ipv4NexthopAddress != null) 'ipv4NexthopAddress=$ipv4NexthopAddress',
    if (ipv6NexthopAddress != null) 'ipv6NexthopAddress=$ipv6NexthopAddress',
    if (linkedVpnTunnel != null) 'linkedVpnTunnel=$linkedVpnTunnel',
    if (md5AuthEnabled != null) 'md5AuthEnabled=$md5AuthEnabled',
    if (name != null) 'name=$name',
    if (numLearnedRoutes != null) 'numLearnedRoutes=$numLearnedRoutes',
    if (peerIpAddress != null) 'peerIpAddress=$peerIpAddress',
    if (peerIpv4NexthopAddress != null)
      'peerIpv4NexthopAddress=$peerIpv4NexthopAddress',
    if (peerIpv6NexthopAddress != null)
      'peerIpv6NexthopAddress=$peerIpv6NexthopAddress',
    if (routerApplianceInstance != null)
      'routerApplianceInstance=$routerApplianceInstance',
    if (state != null) 'state=$state',
    if (status != null) 'status=$status',
    if (statusReason != null) 'statusReason=$statusReason',
    if (uptime != null) 'uptime=$uptime',
    if (uptimeSeconds != null) 'uptimeSeconds=$uptimeSeconds',
  ].join(',');
  return 'RouterStatusBgpPeerStatus(${$contents})';
}