]> git.basschouten.com Git - openhab-addons.git/blob
1ea54d467d66ebfa592cc311b204ca46420bfbf4
[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.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.unifi.internal.handler.UniFiClientThingHandler;
17
18 /**
19  * The {@link UniFiClientThingConfig} encapsulates all the configuration options for an instance of the
20  * {@link UniFiClientThingHandler}.
21  *
22  * @author Matthew Bowman - Initial contribution
23  */
24 @NonNullByDefault
25 @SuppressWarnings("unused")
26 public class UniFiClientThingConfig {
27
28     private String cid = "";
29
30     private String site = "";
31
32     private int considerHome = 180;
33
34     public String getClientID() {
35         return cid;
36     }
37
38     private void setCid(final String cid) {
39         // method to avoid ide auto format mark the field as final
40         this.cid = cid;
41     }
42
43     public String getSite() {
44         return site;
45     }
46
47     private void setSite(final String site) {
48         // method to avoid ide auto format mark the field as final
49         this.site = site;
50     }
51
52     public int getConsiderHome() {
53         return considerHome;
54     }
55
56     public boolean isValid() {
57         return !cid.isBlank();
58     }
59
60     private void setConsiderHome(final int considerHome) {
61         // method to avoid ide auto format mark the field as final
62         this.considerHome = considerHome;
63     }
64
65     @Override
66     public String toString() {
67         return String.format("UniFiClientConfig{cid: '%s', site: '%s', considerHome: %d}", cid, site, considerHome);
68     }
69 }