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