]> git.basschouten.com Git - openhab-addons.git/blob
ec78f4fdac9afea02f0794b5c5f6a771d021bdb7
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.homeconnect.internal.client.model;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * Home appliance model
20  *
21  * @author Jonas BrĂ¼stel - Initial contribution
22  *
23  */
24 @NonNullByDefault
25 public class HomeAppliance {
26     private final String name;
27     private final String brand;
28     private final String vib;
29     private final boolean connected;
30     private final String type;
31     private final String enumber;
32     private final String haId;
33
34     public HomeAppliance(String haId, String name, String brand, String vib, boolean connected, String type,
35             String enumber) {
36         this.haId = haId;
37         this.name = name;
38         this.brand = brand;
39         this.vib = vib;
40         this.connected = connected;
41         this.type = type;
42         this.enumber = enumber;
43     }
44
45     public String getName() {
46         return name;
47     }
48
49     public String getBrand() {
50         return brand;
51     }
52
53     public String getVib() {
54         return vib;
55     }
56
57     public boolean isConnected() {
58         return connected;
59     }
60
61     public String getType() {
62         return type;
63     }
64
65     public String getEnumber() {
66         return enumber;
67     }
68
69     public String getHaId() {
70         return haId;
71     }
72
73     @Override
74     public int hashCode() {
75         final int prime = 31;
76         int result = 1;
77         result = prime * result + haId.hashCode();
78         return result;
79     }
80
81     @Override
82     public boolean equals(@Nullable Object obj) {
83         if (this == obj) {
84             return true;
85         }
86         if (obj == null) {
87             return false;
88         }
89         if (getClass() != obj.getClass()) {
90             return false;
91         }
92         HomeAppliance other = (HomeAppliance) obj;
93         return haId.equals(other.haId);
94     }
95
96     @Override
97     public String toString() {
98         return "HomeAppliance [haId=" + haId + ", name=" + name + ", brand=" + brand + ", vib=" + vib + ", connected="
99                 + connected + ", type=" + type + ", enumber=" + enumber + "]";
100     }
101 }