]> git.basschouten.com Git - openhab-addons.git/blob
e3a40bf9e8cb806a71a58f0b141fdf67ddf3c5e2
[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.lgwebos.internal.handler;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * The {@link LGWebOSConfiguration} class contains the thing configuration
20  * parameters for LGWebOS devices
21  *
22  * @author Sebastian Prehn - Initial contribution
23  */
24 @NonNullByDefault
25 public class LGWebOSConfiguration {
26     @Nullable
27     String host; // name has to match LGWebOSBindingConstants.CONFIG_HOST
28     int port = 3000; // 3001 for TLS
29     @Nullable
30     String key; // name has to match LGWebOSBindingConstants.CONFIG_KEY
31     @Nullable
32     String macAddress; // name has to match LGWebOSBindingConstants.CONFIG_MAC_ADDRESS
33
34     public String getHost() {
35         String h = host;
36         return h == null ? "" : h;
37     }
38
39     public String getKey() {
40         String k = key;
41         return k == null ? "" : k;
42     }
43
44     public int getPort() {
45         return port;
46     }
47
48     public String getMacAddress() {
49         String m = macAddress;
50         return m == null ? "" : m;
51     }
52
53     @Override
54     public String toString() {
55         return "WebOSConfiguration [host=" + host + ", port=" + port + ", key.length=" + getKey().length()
56                 + ", macAddress=" + macAddress + "]";
57     }
58 }