changed toString method to use StringBuilder

This commit is contained in:
Lucas Pleß 2012-03-06 17:57:43 +01:00
parent 06adbd5155
commit 0f63e33da8
2 changed files with 30 additions and 8 deletions

View File

@ -60,8 +60,19 @@ public class Par56Spot extends BuntiDMXDevice {
@Override @Override
public final String toString() { public final String toString() {
return "Par56Spot " + getDeviceId() + ", " + getDeviceName() + " " + StringBuilder sb = new StringBuilder();
"[" + getColorRed() + "," + getColorGreen() + "," + getColorBlue() + "]"; sb.append("Par56Spot ");
sb.append(getDeviceId());
sb.append(", ");
sb.append(getDeviceName());
sb.append(" [");
sb.append(getColorRed());
sb.append(",");
sb.append(getColorGreen());
sb.append(",");
sb.append(getColorBlue());
sb.append("]");
return sb.toString();
} }
} }

View File

@ -57,8 +57,19 @@ public class Strobe1500 extends BuntiDMXDevice {
@Override @Override
public final String toString() { public final String toString() {
return "Strobe1500 " + getDeviceId() + ", " + getDeviceName() + StringBuilder sb = new StringBuilder();
" [" + getSpeed() + "," + getIntensity() + "," + getMode() + "]"; sb.append("Strobe1500 ");
sb.append(getDeviceId());
sb.append(", ");
sb.append(getDeviceName());
sb.append(" [");
sb.append(getSpeed());
sb.append(",");
sb.append(getIntensity());
sb.append(",");
sb.append(getMode());
sb.append("]");
return sb.toString();
} }
} }