]> git.basschouten.com Git - openhab-addons.git/blob
3f0e6fb66d983eb733d4b99fdd66c082a8494e5a
[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.souliss.internal.protocol;
14
15 import java.net.DatagramPacket;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18
19 /**
20  * Data Structure for class SendDispatcherThread
21  *
22  * @author Tonino Fazio - Initial contribution
23  * @author Luca Calcaterra - Refactor for OH3
24  */
25 @NonNullByDefault
26 public class PacketStruct {
27     private DatagramPacket packet;
28
29     public DatagramPacket getPacket() {
30         return packet;
31     }
32
33     private boolean sent = false;
34     private long time = 0;
35
36     public PacketStruct(DatagramPacket packetPar) {
37         packet = packetPar;
38     }
39
40     public long getTime() {
41         return time;
42     }
43
44     public boolean getSent() {
45         return sent;
46     }
47
48     public void setSent(boolean sent) {
49         this.sent = sent;
50     }
51
52     public void setTime(long time) {
53         // set the time only if it has not already been set once
54         if (this.time == 0) {
55             this.time = time;
56         }
57     }
58 }