]> git.basschouten.com Git - openhab-addons.git/blob
b4ca71c4d816b9ae6f8d0b5301319b31db40cfa9
[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.bigassfan.internal;
14
15 /**
16  * The {@link BigAssFanConfig} is responsible for storing the BigAssFan thing configuration.
17  *
18  * @author Mark Hilbush - Initial contribution
19  */
20 public class BigAssFanConfig {
21     /**
22      * Name of the device
23      */
24     private String label;
25
26     /**
27      * IP address of the device
28      */
29     private String ipAddress;
30
31     /**
32      * MAC address of the device
33      */
34     private String macAddress;
35
36     public String getLabel() {
37         return label;
38     }
39
40     public void setLabel(String label) {
41         this.label = label;
42     }
43
44     public String getIpAddress() {
45         return ipAddress;
46     }
47
48     public void setIpAddress(String ipAddress) {
49         this.ipAddress = ipAddress;
50     }
51
52     public String getMacAddress() {
53         return macAddress;
54     }
55
56     public void setMacAddress(String macAddress) {
57         this.macAddress = macAddress;
58     }
59
60     public boolean isValid() {
61         if (label == null || label.isBlank()) {
62             return false;
63         }
64         if (ipAddress == null || ipAddress.isBlank()) {
65             return false;
66         }
67         if (macAddress == null || macAddress.isBlank()) {
68             return false;
69         }
70         return true;
71     }
72
73     @Override
74     public String toString() {
75         return "BigAssFanConfig{label=" + label + ", ipAddress=" + ipAddress + ", macAddress=" + macAddress + "}";
76     }
77 }