Skip to content

Package: KuraMessage

KuraMessage

nameinstructionbranchcomplexitylinemethod
KuraMessage()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
KuraMessage(KuraChannel, Date, KuraPayload)
M: 12 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
getChannel()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getPayload()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getTimestamp()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
setChannel(KuraChannel)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setPayload(KuraPayload)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setTimestamp(Date)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2016, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.service.device.call.message.kura;
14:
15: import org.eclipse.kapua.service.device.call.message.DeviceMessage;
16:
17: import java.util.Date;
18:
19: /**
20: * {@link DeviceMessage} {@link org.eclipse.kapua.service.device.call.kura.Kura} implementation.
21: *
22: * @param <C> The {@link KuraChannel} type.
23: * @param <P> The {@link KuraPayload} type.
24: * @since 1.0.0
25: */
26: public class KuraMessage<C extends KuraChannel, P extends KuraPayload> implements DeviceMessage<C, P> {
27:
28: protected C channel;
29: protected Date timestamp;
30: protected P payload;
31:
32: /**
33: * Constructor
34: *
35: * @since 1.0.0
36: */
37: public KuraMessage() {
38: super();
39: }
40:
41: /**
42: * Constructor.
43: *
44: * @param channel The {@link KuraChannel}.
45: * @param timestamp The timestamp.
46: * @param payload The {@link KuraPayload}.
47: * @see org.eclipse.kapua.service.device.call.message.DeviceMessage
48: * @since 1.0.0
49: */
50: public KuraMessage(C channel, Date timestamp, P payload) {
51: this();
52:
53: this.channel = channel;
54: this.timestamp = timestamp;
55: this.payload = payload;
56: }
57:
58: @Override
59: public C getChannel() {
60: return channel;
61: }
62:
63: @Override
64: public P getPayload() {
65: return payload;
66: }
67:
68: @Override
69: public Date getTimestamp() {
70: return timestamp;
71: }
72:
73: @Override
74: public void setTimestamp(Date timestamp) {
75: this.timestamp = timestamp;
76: }
77:
78: @Override
79: public void setChannel(C channel) {
80: this.channel = channel;
81: }
82:
83: @Override
84: public void setPayload(P payload) {
85: this.payload = payload;
86: }
87: }