]> git.basschouten.com Git - openhab-addons.git/blob
a5cf682cf9c827934cc7d658edd256886dd5d521
[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.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         if (o == null || getClass() != o.getClass())
44             return false;
45         UdpResponseDTO that = (UdpResponseDTO) o;
46         return answer.equals(that.answer) && ipAddress.equals(that.ipAddress);
47     }
48
49     @Override
50     public int hashCode() {
51         return Objects.hash(answer, ipAddress);
52     }
53 }