mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-10 13:21:53 +01:00
[thing] Add toString overrides to ThingImpl & BridgeImpl (#4382)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
This commit is contained in:
parent
5f14cd1c5f
commit
437a885d82
@ -89,4 +89,9 @@ public class BridgeImpl extends ThingImpl implements Bridge {
|
||||
}
|
||||
return bridgeHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString().replace("Bridge=False", "Bridge=True");
|
||||
}
|
||||
}
|
||||
|
@ -237,6 +237,31 @@ public class ThingImpl implements Thing {
|
||||
return ThingStatusDetail.DISABLED != getStatusInfo().getStatusDetail();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
// Configuration is deliberately excluded because it might include sensitive data like passwords.
|
||||
StringBuilder sb = new StringBuilder(getUID().toString());
|
||||
sb.append(" (ThingTypeUID=");
|
||||
sb.append(getThingTypeUID());
|
||||
sb.append(", Bridge=False");
|
||||
if (getBridgeUID() != null) {
|
||||
sb.append(", BridgeUID=");
|
||||
sb.append(getBridgeUID());
|
||||
}
|
||||
sb.append(", Label=");
|
||||
sb.append(getLabel());
|
||||
if (getLocation() != null) {
|
||||
sb.append(", Location=");
|
||||
sb.append(getLocation());
|
||||
}
|
||||
sb.append(", Status=");
|
||||
sb.append(getStatus());
|
||||
sb.append(", StatusInfo=");
|
||||
sb.append(getStatusInfo());
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
|
Loading…
Reference in New Issue
Block a user