]> git.basschouten.com Git - openhab-addons.git/blob
4f05ba2980d8a9e1d57205be87abb0947712675d
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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.unifi.internal;
14
15 import org.apache.commons.lang.StringUtils;
16 import org.openhab.binding.unifi.internal.handler.UniFiControllerThingHandler;
17
18 /**
19  * The {@link UniFiControllerThingConfig} encapsulates all the configuration options for an instance of the
20  * {@link UniFiControllerThingHandler}.
21  *
22  * @author Matthew Bowman - Initial contribution
23  */
24 public class UniFiControllerThingConfig {
25
26     private String host = "unifi";
27
28     private int port = 8443;
29
30     private String username = "";
31
32     private String password = "";
33
34     private int refresh = 10;
35
36     private boolean unifios = false;
37
38     public String getHost() {
39         return host;
40     }
41
42     public int getPort() {
43         return port;
44     }
45
46     public String getUsername() {
47         return username;
48     }
49
50     public String getPassword() {
51         return password;
52     }
53
54     public int getRefresh() {
55         return refresh;
56     }
57
58     public boolean isUniFiOS() {
59         return unifios;
60     }
61
62     public boolean isValid() {
63         return StringUtils.isNotBlank(host) && StringUtils.isNotBlank(username) && StringUtils.isNotBlank(password);
64     }
65
66     @Override
67     public String toString() {
68         return "UniFiControllerConfig{host = " + host + ", port = " + port + ", username = " + username
69                 + ", password = *****, refresh = " + refresh + ", unifios = " + unifios + "}";
70     }
71 }