• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wz2cool / local-queue / #94

06 Jul 2025 07:25AM UTC coverage: 85.65% (-5.2%) from 90.82%
#94

push

wz2cool
add option

4 of 20 new or added lines in 4 files covered. (20.0%)

758 of 885 relevant lines covered (85.65%)

0.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.43
/src/main/java/com/github/wz2cool/localqueue/model/message/QueueMessage.java
1
package com.github.wz2cool.localqueue.model.message;
2

3
import com.github.wz2cool.localqueue.model.message.internal.HeaderMessage;
4

5
import java.util.HashSet;
6
import java.util.Objects;
7
import java.util.Optional;
8
import java.util.Set;
9

10
/**
11
 * queue message
12
 *
13
 * @author frank
14
 */
15
public class QueueMessage {
16

17
    private final int positionVersion;
18
    private final long position;
19
    private final String content;
20
    private final long writeTime;
21
    private final String messageKey;
22
    private final String tag;
23
    private final HeaderMessage headerMessage;
24

25
    /**
26
     * constructor
27
     *
28
     * @param tag             tag
29
     * @param messageKey      message key
30
     * @param positionVersion position version
31
     * @param position        position of queue
32
     * @param content         content
33
     * @param writeTime       write time
34
     */
35
    public QueueMessage(
36
            String tag,
37
            String messageKey,
38
            int positionVersion,
39
            long position,
40
            String content,
41
            long writeTime,
42
            HeaderMessage headerMessage) {
1✔
43
        this.tag = tag;
1✔
44
        this.messageKey = messageKey;
1✔
45
        this.positionVersion = positionVersion;
1✔
46
        this.position = position;
1✔
47
        this.content = content;
1✔
48
        this.writeTime = writeTime;
1✔
49
        this.headerMessage = headerMessage;
1✔
50
    }
1✔
51

52
    public long getPosition() {
53
        return position;
1✔
54
    }
55

56
    public String getContent() {
57
        return content;
1✔
58
    }
59

60
    public int getPositionVersion() {
61
        return positionVersion;
1✔
62
    }
63

64
    public long getWriteTime() {
65
        return writeTime;
1✔
66
    }
67

68
    public String getMessageKey() {
69
        return messageKey;
1✔
70
    }
71

72
    public String getTag() {
73
        return tag;
1✔
74
    }
75

76
    public Optional<String> getHeaderValue(String headerKey) {
NEW
77
        if (Objects.isNull(headerMessage)) {
×
NEW
78
            return Optional.empty();
×
79
        }
NEW
80
        return headerMessage.getHeaderValue(headerKey);
×
81
    }
82

83
    public Set<String> getHeaderKeys() {
NEW
84
        if (Objects.isNull(headerMessage)) {
×
NEW
85
            return new HashSet<>();
×
86
        }
NEW
87
        return headerMessage.getHeaderKeys();
×
88
    }
89
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc