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

wz2cool / local-queue / #82

06 Feb 2025 03:31PM UTC coverage: 91.284% (-0.3%) from 91.534%
#82

push

wz2cool
support headers

68 of 70 new or added lines in 5 files covered. (97.14%)

3 existing lines in 1 file now uncovered.

775 of 849 relevant lines covered (91.28%)

0.91 hits per line

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

94.44
/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.Objects;
6
import java.util.Optional;
7

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

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

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

43
    public long getPosition() {
44
        return position;
1✔
45
    }
46

47
    public String getContent() {
48
        return content;
1✔
49
    }
50

51
    public int getPositionVersion() {
52
        return positionVersion;
1✔
53
    }
54

55
    public long getWriteTime() {
56
        return writeTime;
1✔
57
    }
58

59
    public String getMessageKey() {
60
        return messageKey;
1✔
61
    }
62

63
    public String getTag() {
64
        return tag;
1✔
65
    }
66

67
    public Optional<String> getHeader(String key) {
68
        if (Objects.isNull(headerMessage)) {
1✔
NEW
69
            return Optional.empty();
×
70
        }
71
        return headerMessage.getHeader(key);
1✔
72
    }
73
}
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