Search in sources :

Example 1 with ToStringBuilder

use of org.apache.commons.lang.builder.ToStringBuilder in project openhab1-addons by openhab.

the class WeatherBindingConfig method toString.

/**
     * {@inheritDoc}
     */
@Override
public String toString() {
    ToStringBuilder tsb = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
    tsb.append("locationId", locationId).append("type", type).append("property", property);
    if (roundingMode != null) {
        tsb.append("roundingMode", roundingMode).append("scale", scale);
    }
    if (unit != null) {
        tsb.append("unit", unit.toString());
    }
    return tsb.toString();
}
Also used : ToStringBuilder(org.apache.commons.lang.builder.ToStringBuilder)

Example 2 with ToStringBuilder

use of org.apache.commons.lang.builder.ToStringBuilder in project openhab1-addons by openhab.

the class Weather method toString.

/**
     * {@inheritDoc}
     */
@Override
public String toString() {
    ToStringBuilder tsb = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
    if (this instanceof org.openhab.binding.weather.internal.model.Forecast) {
        tsb.append("day", ((org.openhab.binding.weather.internal.model.Forecast) this).getDay());
    }
    tsb.append(temperature).append(atmosphere).append(clouds).append(condition).append(precipitation).append(wind).append(station).append(error);
    return tsb.toString();
}
Also used : Forecast(org.openhab.binding.weather.internal.annotation.Forecast) ToStringBuilder(org.apache.commons.lang.builder.ToStringBuilder)

Example 3 with ToStringBuilder

use of org.apache.commons.lang.builder.ToStringBuilder in project openhab1-addons by openhab.

the class AstroConfig method toString.

@Override
public String toString() {
    String intervallMessage = (interval == 0 ? "disabled" : String.valueOf(interval));
    TimeZone tz = TimeZone.getDefault();
    StringBuilder tzInfo = new StringBuilder();
    tzInfo.append(tz.getID());
    tzInfo.append(" (").append(tz.getDisplayName(false, TimeZone.SHORT)).append(" ").append(new SimpleDateFormat("Z").format(Calendar.getInstance().getTime()));
    tzInfo.append(")");
    return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("latitude", latitude).append("longitude", longitude).append("interval", intervallMessage).append("systemTimezone", tzInfo.toString()).append("daylightSavings", Calendar.getInstance().get(Calendar.DST_OFFSET) != 0).toString();
}
Also used : TimeZone(java.util.TimeZone) ToStringBuilder(org.apache.commons.lang.builder.ToStringBuilder) ToStringBuilder(org.apache.commons.lang.builder.ToStringBuilder) SimpleDateFormat(java.text.SimpleDateFormat)

Example 4 with ToStringBuilder

use of org.apache.commons.lang.builder.ToStringBuilder in project openhab1-addons by openhab.

the class RefreshTokenRequest method toString.

@Override
public String toString() {
    final ToStringBuilder builder = createToStringBuilder();
    builder.appendSuper(super.toString());
    builder.append("clientId", this.clientId);
    builder.append("clientSecret", this.clientSecret);
    builder.append("refreshToken", this.refreshToken);
    return builder.toString();
}
Also used : ToStringBuilder(org.apache.commons.lang.builder.ToStringBuilder)

Example 5 with ToStringBuilder

use of org.apache.commons.lang.builder.ToStringBuilder in project openhab1-addons by openhab.

the class GetHomeDataRequest method toString.

@Override
public String toString() {
    final ToStringBuilder builder = createToStringBuilder();
    builder.appendSuper(super.toString());
    builder.append("accessToken", this.accessToken);
    return builder.toString();
}
Also used : ToStringBuilder(org.apache.commons.lang.builder.ToStringBuilder)

Aggregations

ToStringBuilder (org.apache.commons.lang.builder.ToStringBuilder)112 SimpleDateFormat (java.text.SimpleDateFormat)2 TimeZone (java.util.TimeZone)2 DataMap (com.linkedin.data.DataMap)1 ProtocolVersion (com.linkedin.restli.common.ProtocolVersion)1 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 AccessibleObject (java.lang.reflect.AccessibleObject)1 InetAddress (java.net.InetAddress)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 Collectors (java.util.stream.Collectors)1