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() {
  String SEP = "\n";
  StringBuffer sb = StringBuffer();
  sb.write("---------------- TABLE" + SEP);
  sb.write("table_id   : $table_id" + SEP);
  sb.write("table_name : $table_name" + SEP);
  sb.write("---------------- FIELDS" + SEP);
  List<FieldMetaData> list = getFieldList();
  if (list == null || list.length == 0)
    sb.write("<No Fields>" + SEP);
  else {
    getFieldList().forEach((fmd) {
      sb.write(fmd);
    });
  }
  sb.write("---------------- PROPERTIES" + SEP);
  if (_propertiesMap == null)
    sb.write("<No Properties>" + SEP);
  else {
    _propertiesMap!.forEach((k, v) {
      sb.write("$k:$v,");
    });
    sb.write(SEP);
  }
  return sb.toString();
}