diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2013-09-09 03:06:40 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2013-09-09 03:06:40 +0000 |
commit | 613141a12aaca99045c6ac886ab1633190b9085d (patch) | |
tree | 5792dcaa52a92ac4ccbb2a2d36fb9867cd7d5a69 /src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java | |
parent | a1940946b9c3538ac905ddf0fb60680e53ec98ee (diff) | |
download | jackcess-613141a12aaca99045c6ac886ab1633190b9085d.tar.gz jackcess-613141a12aaca99045c6ac886ab1633190b9085d.zip |
revamp tostring output
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@794 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java')
-rw-r--r-- | src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java index 125508e..4cd3365 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java @@ -2085,24 +2085,18 @@ public class TableImpl implements Table @Override public String toString() { - StringBuilder rtn = new StringBuilder(); - rtn.append("Type: " + _tableType + - ((_tableType == TYPE_USER) ? " (USER)" : " (SYSTEM)")); - rtn.append("\nName: " + _name); - rtn.append("\nRow count: " + _rowCount); - rtn.append("\nColumn count: " + _columns.size()); - rtn.append("\nIndex (data) count: " + _indexCount); - rtn.append("\nLogical Index count: " + _logicalIndexCount); - rtn.append("\nColumns:\n"); - for(ColumnImpl col : _columns) { - rtn.append(col); - } - rtn.append("\nIndexes:\n"); - for(Index index : _indexes) { - rtn.append(index); - } - rtn.append("\nOwned pages: " + _ownedPages + "\n"); - return rtn.toString(); + return CustomToStringStyle.builder(this) + .append("type", (_tableType + + ((_tableType == TYPE_USER) ? " (USER)" : " (SYSTEM)"))) + .append("name", _name) + .append("rowCount", _rowCount) + .append("columnCount", _columns.size()) + .append("indexCount(data)", _indexCount) + .append("logicalIndexCount", _logicalIndexCount) + .append("columns", _columns) + .append("indexes", _indexes) + .append("ownedPages", _ownedPages) + .toString(); } /** @@ -2553,10 +2547,11 @@ public class TableImpl implements Table } @Override - public String toString() - { - return "RowState: headerRowId = " + _headerRowId + ", finalRowId = " + - _finalRowId; + public String toString() { + return CustomToStringStyle.valueBuilder(this) + .append("headerRowId", _headerRowId) + .append("finalRowId", _finalRowId) + .toString(); } } |