]> git.basschouten.com Git - openhab-addons.git/blob
2eea87d94aaca1d94e87cb4b37ffaf344e94653d
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 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     public String getHost() {
37         return host;
38     }
39
40     public int getPort() {
41         return port;
42     }
43
44     public String getUsername() {
45         return username;
46     }
47
48     public String getPassword() {
49         return password;
50     }
51
52     public int getRefresh() {
53         return refresh;
54     }
55
56     public boolean isValid() {
57         return StringUtils.isNotBlank(host) && StringUtils.isNotBlank(username) && StringUtils.isNotBlank(password);
58     }
59
60     @Override
61     public String toString() {
62         return "UniFiControllerConfig{host = " + host + ", port = " + port + ", username = " + username
63                 + ", password = *****, refresh = " + refresh + "}";
64     }
65 }