]> git.basschouten.com Git - openhab-addons.git/blob
5ba076b33f2e9245810a2bb728928fab55d88b6c
[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.etherrain.internal.api;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * The {@link EtherRainUdpResponse} is an encapsulation of the UDP broadcast response from the EtherRain
19  *
20  * @author Joe Inkenbrandt - Initial contribution
21  */
22
23 @NonNullByDefault
24 public class EtherRainUdpResponse {
25     private final boolean valid;
26     private final String type;
27     private final String address;
28     private final int port;
29     private final String uniqueName;
30     private final String additionalParameters; // Note: version 3.77 of spec says this is unused
31
32     public EtherRainUdpResponse(String type, String address, int port, String uniqueName, String additionalParameters) {
33         this.valid = true;
34         this.type = type;
35         this.address = address;
36         this.port = port;
37         this.uniqueName = uniqueName;
38         this.additionalParameters = additionalParameters;
39     }
40
41     public EtherRainUdpResponse() {
42         this.valid = false;
43         this.type = "";
44         this.address = "";
45         this.port = 0;
46         this.uniqueName = "";
47         this.additionalParameters = "";
48     }
49
50     public boolean isValid() {
51         return valid;
52     }
53
54     public String getType() {
55         return type;
56     }
57
58     public String getAddress() {
59         return address;
60     }
61
62     public int getPort() {
63         return port;
64     }
65
66     public String getUnqiueName() {
67         return uniqueName;
68     }
69
70     public String getAdditionalParameters() {
71         return additionalParameters;
72     }
73 }