]> git.basschouten.com Git - openhab-addons.git/blob
93bd267f67e088d2abf4a1345046869a4a41358e
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.ihc.internal.ws.datatypes;
14
15 /**
16  * Class for WSRFDevice complex type.
17  *
18  * @author Pauli Anttila - Initial contribution
19  */
20 public class WSRFDevice {
21
22     private int batteryLevel;
23     private int deviceType;
24     private long serialNumber;
25     private int signalStrength;
26     private int version;
27     private boolean detected;
28
29     public WSRFDevice() {
30     }
31
32     public WSRFDevice(int batteryLevel, int deviceType, long serialNumber, int signalStrength, int version,
33             boolean detected) {
34         this.batteryLevel = batteryLevel;
35         this.deviceType = deviceType;
36         this.serialNumber = serialNumber;
37         this.signalStrength = signalStrength;
38         this.version = version;
39         this.detected = detected;
40     }
41
42     /**
43      * Gets the battery level value for this WSRFDevice.
44      *
45      * @return Battery Level
46      */
47     public int getBatteryLevel() {
48         return batteryLevel;
49     }
50
51     /**
52      * Sets the battery level value for this WSRFDevice.
53      *
54      * @param batteryLevel battery level
55      */
56     public void setBatteryLevel(int batteryLevel) {
57         this.batteryLevel = batteryLevel;
58     }
59
60     /**
61      * Gets the device type value for this WSRFDevice.
62      *
63      * @return device type
64      */
65     public int getDeviceType() {
66         return deviceType;
67     }
68
69     /**
70      * Sets the device type value for this WSRFDevice.
71      *
72      * @param device type
73      */
74     public void setDeviceType(int deviceType) {
75         this.deviceType = deviceType;
76     }
77
78     /**
79      * Gets the serial number value for this WSRFDevice.
80      *
81      * @return Serial number
82      */
83     public long getSerialNumber() {
84         return serialNumber;
85     }
86
87     /**
88      * Sets the serial number value for this WSRFDevice.
89      *
90      * @param Serial number
91      */
92     public void setSerialNumber(long serialNumber) {
93         this.serialNumber = serialNumber;
94     }
95
96     /**
97      * Gets the signal strength value for this WSRFDevice.
98      *
99      * @return Signal strength
100      */
101     public int getSignalStrength() {
102         return signalStrength;
103     }
104
105     /**
106      * Sets the signal strength value for this WSRFDevice.
107      *
108      * @param signalStrength Signal strength
109      */
110     public void setSignalStrength(int signalStrength) {
111         this.signalStrength = signalStrength;
112     }
113
114     /**
115      * Gets the version value for this WSRFDevice.
116      *
117      * @return version
118      */
119     public int getVersion() {
120         return version;
121     }
122
123     /**
124      * Sets the version value for this WSRFDevice.
125      *
126      * @param version
127      */
128     public void setVersion(int version) {
129         this.version = version;
130     }
131
132     /**
133      * Gets the detected value for this WSRFDevice.
134      *
135      * @return Detected
136      */
137     public boolean getDetected() {
138         return detected;
139     }
140
141     /**
142      * Sets the detected value for this WSRFDevice.
143      *
144      * @param detected
145      */
146     public void setdetected(boolean detected) {
147         this.detected = detected;
148     }
149
150     @Override
151     public String toString() {
152         return String.format(
153                 "[ batteryLevel=%d, deviceType=%d, serialNumber=%d, signalStrength=%d, version=%d, detected=%b ]",
154                 batteryLevel, deviceType, serialNumber, signalStrength, version, detected);
155     }
156 }