Sho SHIMIZU

Simplify String concatenation

Change-Id: I266cc74d80c22675cffd539260171f9044fc1b78
...@@ -153,19 +153,16 @@ public final class DefaultPortStatistics implements PortStatistics { ...@@ -153,19 +153,16 @@ public final class DefaultPortStatistics implements PortStatistics {
153 153
154 @Override 154 @Override
155 public String toString() { 155 public String toString() {
156 - StringBuilder sb = new StringBuilder("device: " + deviceId + ", "); 156 + return "device: " + deviceId + ", " +
157 - 157 + "port: " + this.port + ", " +
158 - sb.append("port: " + this.port + ", "); 158 + "pktRx: " + this.packetsReceived + ", " +
159 - sb.append("pktRx: " + this.packetsReceived + ", "); 159 + "pktTx: " + this.packetsSent + ", " +
160 - sb.append("pktTx: " + this.packetsSent + ", "); 160 + "byteRx: " + this.bytesReceived + ", " +
161 - sb.append("byteRx: " + this.bytesReceived + ", "); 161 + "byteTx: " + this.bytesSent + ", " +
162 - sb.append("byteTx: " + this.bytesSent + ", "); 162 + "pktRxErr: " + this.packetsRxErrors + ", " +
163 - sb.append("pktRxErr: " + this.packetsRxErrors + ", "); 163 + "pktTxErr: " + this.packetsTxErrors + ", " +
164 - sb.append("pktTxErr: " + this.packetsTxErrors + ", "); 164 + "pktRxDrp: " + this.packetsRxDropped + ", " +
165 - sb.append("pktRxDrp: " + this.packetsRxDropped + ", "); 165 + "pktTxDrp: " + this.packetsTxDropped;
166 - sb.append("pktTxDrp: " + this.packetsTxDropped);
167 -
168 - return sb.toString();
169 } 166 }
170 167
171 public static final class Builder { 168 public static final class Builder {
......
...@@ -52,14 +52,11 @@ public final class DefaultTableStatisticsEntry implements TableStatisticsEntry { ...@@ -52,14 +52,11 @@ public final class DefaultTableStatisticsEntry implements TableStatisticsEntry {
52 52
53 @Override 53 @Override
54 public String toString() { 54 public String toString() {
55 - StringBuilder sb = new StringBuilder("device: " + deviceId + ", "); 55 + return "device: " + deviceId + ", " +
56 - 56 + "tableId: " + this.tableId + ", " +
57 - sb.append("tableId: " + this.tableId + ", "); 57 + "activeEntries: " + this.activeFlowEntries + ", " +
58 - sb.append("activeEntries: " + this.activeFlowEntries + ", "); 58 + "packetsLookedUp: " + this.packetsLookedupCount + ", " +
59 - sb.append("packetsLookedUp: " + this.packetsLookedupCount + ", "); 59 + "packetsMatched: " + this.packetsMatchedCount;
60 - sb.append("packetsMatched: " + this.packetsMatchedCount);
61 -
62 - return sb.toString();
63 } 60 }
64 61
65 @Override 62 @Override
......