Search in sources :

Example 51 with ToStringBuilder

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();
}
Also used : ToStringBuilder(org.apache.commons.lang.builder.ToStringBuilder)

Example 52 with ToStringBuilder

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());
    }
}
Also used : CommonId(org.openhab.binding.weather.internal.model.common.CommonId) Condition(org.openhab.binding.weather.internal.model.Condition) ToStringBuilder(org.apache.commons.lang.builder.ToStringBuilder)

Example 53 with ToStringBuilder

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();
}
Also used : ToStringBuilder(org.apache.commons.lang.builder.ToStringBuilder)

Example 54 with ToStringBuilder

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();
}
Also used : ToStringBuilder(org.apache.commons.lang.builder.ToStringBuilder)

Example 55 with ToStringBuilder

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();
}
Also used : ToStringBuilder(org.apache.commons.lang.builder.ToStringBuilder)

Aggregations

ToStringBuilder (org.apache.commons.lang.builder.ToStringBuilder)73 DataMap (com.linkedin.data.DataMap)1 ProtocolVersion (com.linkedin.restli.common.ProtocolVersion)1 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 InetAddress (java.net.InetAddress)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Map (java.util.Map)1 Properties (java.util.Properties)1 Set (java.util.Set)1 TimeZone (java.util.TimeZone)1 Collectors (java.util.stream.Collectors)1 Level (org.apache.logging.log4j.Level)1