2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.unifi.internal;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.unifi.internal.handler.UniFiControllerThingHandler;
19 * The {@link UniFiControllerThingConfig} encapsulates all the configuration options for an instance of the
20 * {@link UniFiControllerThingHandler}.
22 * @author Matthew Bowman - Initial contribution
25 @SuppressWarnings("unused")
26 public class UniFiControllerThingConfig {
28 private String host = "unifi";
30 private int port = 8443;
32 private String username = "";
34 private String password = "";
36 private int refresh = 10;
38 private boolean unifios = false;
40 public String getHost() {
44 private void setHost(final String host) {
45 // method to avoid ide auto format mark the field as final
49 public int getPort() {
53 private void setPort(final int port) {
54 // method to avoid ide auto format mark the field as final
58 public String getUsername() {
62 private void setUsername(final String username) {
63 // method to avoid ide auto format mark the field as final
64 this.username = username;
67 public String getPassword() {
71 private void setPassword(final String password) {
72 // method to avoid ide auto format mark the field as final
73 this.password = password;
76 public int getRefresh() {
80 private void setRefresh(final int refresh) {
81 // method to avoid ide auto format mark the field as final
82 this.refresh = refresh;
85 public boolean isUniFiOS() {
89 private void setUnifiOS(final boolean unifios) {
90 // method to avoid ide auto format mark the field as final
91 this.unifios = unifios;
94 public boolean isValid() {
95 return !host.isBlank() && !username.isBlank() && !password.isBlank();
99 public String toString() {
100 return "UniFiControllerConfig{host = " + host + ", port = " + port + ", username = " + username
101 + ", password = *****, refresh = " + refresh + ", unifios = " + unifios + "}";