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