]> git.basschouten.com Git - openhab-addons.git/blob
916757a981a4489ea728b28f23df1b30fcb4cf3b
[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.mielecloud.internal.webservice.api.json;
14
15 import java.util.Objects;
16 import java.util.Optional;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
20
21 /**
22  * Immutable POJO representing the remote control capabilities of a device. Queried from the Miele REST API.
23  *
24  * @author Björn Lange - Initial contribution
25  */
26 @NonNullByDefault
27 public class RemoteEnable {
28     @Nullable
29     private Boolean fullRemoteControl;
30     @Nullable
31     private Boolean smartGrid;
32
33     public Optional<Boolean> getFullRemoteControl() {
34         return Optional.ofNullable(fullRemoteControl);
35     }
36
37     public Optional<Boolean> getSmartGrid() {
38         return Optional.ofNullable(smartGrid);
39     }
40
41     @Override
42     public int hashCode() {
43         return Objects.hash(fullRemoteControl, smartGrid);
44     }
45
46     @Override
47     public boolean equals(@Nullable Object obj) {
48         if (this == obj) {
49             return true;
50         }
51         if (obj == null) {
52             return false;
53         }
54         if (getClass() != obj.getClass()) {
55             return false;
56         }
57         RemoteEnable other = (RemoteEnable) obj;
58         return Objects.equals(fullRemoteControl, other.fullRemoteControl) && Objects.equals(smartGrid, other.smartGrid);
59     }
60
61     @Override
62     public String toString() {
63         return "RemoteEnable [fullRemoteControl=" + fullRemoteControl + ", smartGrid=" + smartGrid + "]";
64     }
65 }