use of org.apache.commons.lang.builder.ToStringBuilder in project openhab1-addons by openhab.
the class DataModelResponse method toString.
@Override
public String toString() {
final ToStringBuilder builder = createToStringBuilder();
builder.appendSuper(super.toString());
builder.append("error", this.error);
return builder.toString();
}
use of org.apache.commons.lang.builder.ToStringBuilder in project openhab1-addons by openhab.
the class CommonIdHandler method setCommonId.
/**
* Sets the common condition id into the weather object.
*/
public void setCommonId(Weather weather) {
Map<String, CommonId> commonIds = providerCommonIds.get(weather.getProvider());
if (commonIds == null) {
throw new RuntimeException("No common ids for provider " + weather.getProvider() + " declared");
}
Condition cond = weather.getCondition();
CommonId cid = commonIds.get(cond.getId());
if (cid == null) {
cid = commonIds.get(cond.getIcon());
}
if (cid != null) {
cond.setCommonId(cid.getId());
} else {
ToStringBuilder tsb = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("provider", weather.getProvider()).append("id", cond.getId()).append("icon", cond.getIcon());
logger.warn("CommonId not found: {}", tsb.toString());
}
}
use of org.apache.commons.lang.builder.ToStringBuilder in project openhab1-addons by openhab.
the class ForecastBindingConfig method toString.
/**
* {@inheritDoc}
*/
@Override
public String toString() {
ToStringBuilder tsb = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
tsb.append("locationId", getLocationId()).append("forecast", forecastDay).append("type", getType()).append("property", getProperty());
if (getRoundingMode() != null) {
tsb.append("roundingMode", getRoundingMode()).append("scale", getScale());
}
if (getUnit() != null) {
tsb.append("unit", getUnit().toString());
}
return tsb.toString();
}
use of org.apache.commons.lang.builder.ToStringBuilder in project opennms by OpenNMS.
the class CdpLink method toString.
/**
* <p>toString</p>
*
* @return a {@link java.lang.String} object.
*/
public String toString() {
Integer nodeid = null;
if (m_node != null)
nodeid = m_node.getId();
String cdpCacheAddressTypeString = null;
if (m_cdpCacheAddressType != null)
cdpCacheAddressTypeString = CiscoNetworkProtocolType.getTypeString(m_cdpCacheAddressType.getValue());
return new ToStringBuilder(this).append("NodeId", nodeid).append("cdpCacheIfIndex", m_cdpCacheIfIndex).append("cdpCacheDeviceIndex", m_cdpCacheDeviceIndex).append("cdpInterfaceName", m_cdpInterfaceName).append("cdpCacheAddressType", cdpCacheAddressTypeString).append("cdpCacheAddress", m_cdpCacheAddress).append("cdpCacheVersion", m_cdpCacheVersion).append("cdpCachedeviceId", m_cdpCacheDeviceId).append("cdpCachedevicePort", m_cdpCacheDevicePort).append("cdpCachedevicePlatform", m_cdpCacheDevicePlatform).append("createTime", m_cdpLinkCreateTime).append("lastPollTime", m_cdpLinkLastPollTime).toString();
}
use of org.apache.commons.lang.builder.ToStringBuilder in project openhab1-addons by openhab.
the class ApiResponse method toString.
@Override
public String toString() {
final ToStringBuilder builder = createToStringBuilder();
builder.appendSuper(super.toString());
if (this.status != null) {
builder.append("status", this.status);
}
return builder.toString();
}
Aggregations