]> git.basschouten.com Git - openhab-addons.git/blob
7df5c4fcfc7f6e643d752a5d9ed8dd992df13522
[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.revogi.internal.api;
14
15 import java.util.Objects;
16
17 /**
18  * The class {@link SwitchResponseDTO} describes the response when you switch a plug
19  *
20  * @author Andi Bräu - Initial contribution
21  */
22 public class SwitchResponseDTO {
23     private final int response;
24     private final int code;
25
26     public SwitchResponseDTO(int response, int code) {
27         this.response = response;
28         this.code = code;
29     }
30
31     public int getResponse() {
32         return response;
33     }
34
35     public int getCode() {
36         return code;
37     }
38
39     @Override
40     public boolean equals(Object o) {
41         if (this == o) {
42             return true;
43         }
44         if (o == null || getClass() != o.getClass()) {
45             return false;
46         }
47         SwitchResponseDTO that = (SwitchResponseDTO) o;
48         return response == that.response && code == that.code;
49     }
50
51     @Override
52     public int hashCode() {
53         return Objects.hash(response, code);
54     }
55 }