]> git.basschouten.com Git - openhab-addons.git/blob
8f77e845701e1cbcbcb3b9e02c601d754d9fc852
[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.udp;
14
15 import java.util.Objects;
16
17 /**
18  * The class {@link UdpResponseDTO} represents udp reponse we expect
19  *
20  * @author Andi Bräu - Initial contribution
21  */
22 public class UdpResponseDTO {
23     private final String answer;
24     private final String ipAddress;
25
26     public UdpResponseDTO(String answer, String ipAddress) {
27         this.answer = answer;
28         this.ipAddress = ipAddress;
29     }
30
31     public String getAnswer() {
32         return answer;
33     }
34
35     public String getIpAddress() {
36         return ipAddress;
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         UdpResponseDTO that = (UdpResponseDTO) o;
48         return answer.equals(that.answer) && ipAddress.equals(that.ipAddress);
49     }
50
51     @Override
52     public int hashCode() {
53         return Objects.hash(answer, ipAddress);
54     }
55 }