toString method

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

String toString() {
  StringBuffer ret = new StringBuffer("SpaceDesc(");

  ret.write("space_name:");
  if (this.space_name == null) {
    ret.write("null");
  } else {
    ret.write("BINARY");
  }

  ret.write(", ");
  ret.write("partition_num:");
  ret.write(this.partition_num);

  ret.write(", ");
  ret.write("replica_factor:");
  ret.write(this.replica_factor);

  ret.write(", ");
  ret.write("charset_name:");
  if (this.charset_name == null) {
    ret.write("null");
  } else {
    ret.write("BINARY");
  }

  ret.write(", ");
  ret.write("collate_name:");
  if (this.collate_name == null) {
    ret.write("null");
  } else {
    ret.write("BINARY");
  }

  ret.write(", ");
  ret.write("vid_type:");
  if (this.vid_type == null) {
    ret.write("null");
  } else {
    ret.write(this.vid_type);
  }

  ret.write(", ");
  ret.write("zone_names:");
  if (this.zone_names == null) {
    ret.write("null");
  } else {
    ret.write(this.zone_names);
  }

  if (isSetIsolation_level()) {
    ret.write(", ");
    ret.write("isolation_level:");
    String? isolation_level_name =
        IsolationLevel.VALUES_TO_NAMES[this.isolation_level];
    if (isolation_level_name != null) {
      ret.write(isolation_level_name);
      ret.write(" (");
    }
    ret.write(this.isolation_level);
    if (isolation_level_name != null) {
      ret.write(")");
    }
  }

  if (isSetComment()) {
    ret.write(", ");
    ret.write("comment:");
    if (this.comment == null) {
      ret.write("null");
    } else {
      ret.write("BINARY");
    }
  }

  ret.write(")");

  return ret.toString();
}