2 * Copyright (c) 2010-2021 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.homematic.internal.model;
15 import org.apache.commons.lang.builder.ToStringBuilder;
16 import org.apache.commons.lang.builder.ToStringStyle;
19 * Object that holds the rssi infos for a RF device.
21 * @author Gerhard Riegler - Initial contribution
24 public class HmRssiInfo {
25 private String address;
26 private Integer device;
29 public HmRssiInfo(String address, Integer device, Integer peer) {
30 this.address = address;
31 this.device = convert(device);
32 this.peer = convert(peer);
36 * Converts the rssi value to null if necessary.
38 private Integer convert(Integer intValue) {
39 if (intValue == null || intValue == 65536) {
46 * Returns the address of the device.
48 public String getAddress() {
53 * Returns the device rssi.
55 public Integer getDevice() {
60 * Returns the peer rssi.
62 public Integer getPeer() {
67 public String toString() {
68 return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("address", address)
69 .append("device", device).append("peer", peer).toString();