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

apache / rocketmq-dashboard / 200

pending completion
200

Pull #130

travis-ci-com

web-flow
Merge e87e98135 into 86bdb0636
Pull Request #130: Bump snakeyaml from 1.30 to 1.32

2374 of 2869 relevant lines covered (82.75%)

1.65 hits per line

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

53.57
/src/main/java/org/apache/rocketmq/dashboard/model/MessageQueryByPage.java
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *     http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
package org.apache.rocketmq.dashboard.model;
18

19

20
import org.springframework.data.domain.PageRequest;
21

22
public class MessageQueryByPage {
23
    public static final int DEFAULT_PAGE = 0;
24

25
    public static final int MIN_PAGE_SIZE = 10;
26

27
    public static final int MAX_PAGE_SIZE = 100;
28

29
    /**
30
     * current page num
31
     */
32
    private int pageNum;
33

34
    private int pageSize;
35

36
    private String topic;
37
    private long begin;
38
    private long end;
39

40
    public MessageQueryByPage(int pageNum, int pageSize, String topic, long begin, long end) {
2✔
41
        this.pageNum = pageNum;
2✔
42
        this.pageSize = pageSize;
2✔
43
        this.topic = topic;
2✔
44
        this.begin = begin;
2✔
45
        this.end = end;
2✔
46
    }
2✔
47

48
    public void setPageNum(int pageNum) {
49
        this.pageNum = pageNum;
×
50
    }
×
51

52
    public void setPageSize(int pageSize) {
53
        this.pageSize = pageSize;
×
54
    }
×
55

56
    public String getTopic() {
57
        return topic;
2✔
58
    }
59

60
    public void setTopic(String topic) {
61
        this.topic = topic;
×
62
    }
×
63

64
    public long getBegin() {
65
        return begin;
2✔
66
    }
67

68
    public void setBegin(long begin) {
69
        this.begin = begin;
×
70
    }
×
71

72
    public long getEnd() {
73
        return end;
2✔
74
    }
75

76
    public void setEnd(long end) {
77
        this.end = end;
×
78
    }
×
79

80
    public int getPageNum() {
81
        return pageNum <= 0 ? DEFAULT_PAGE : pageNum - 1;
2✔
82
    }
83

84
    public int getPageSize() {
85
        if (pageSize <= 1) {
2✔
86
            return MIN_PAGE_SIZE;
×
87
        } else if (pageSize > MAX_PAGE_SIZE) {
2✔
88
            return MAX_PAGE_SIZE;
×
89
        }
90
        return this.pageSize;
2✔
91
    }
92

93
    public PageRequest page() {
94
        return PageRequest.of(this.getPageNum(), this.getPageSize());
2✔
95
    }
96

97
    @Override
98
    public String toString() {
99
        return "MessageQueryByPage{" +
×
100
                "pageNum=" + pageNum +
101
                ", pageSize=" + pageSize +
102
                ", topic='" + topic + '\'' +
103
                ", begin=" + begin +
104
                ", end=" + end +
105
                '}';
106
    }
107
}
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

© 2025 Coveralls, Inc