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

openmrs / openmrs-core / 14752386992

30 Apr 2025 10:25AM UTC coverage: 64.96% (-0.1%) from 65.095%
14752386992

push

github

web-flow
TRUNK-6316 Upgrade Hibernate Search to 6.2.4 (#5005)

501 of 591 new or added lines in 24 files covered. (84.77%)

21 existing lines in 6 files now uncovered.

23344 of 35936 relevant lines covered (64.96%)

0.65 hits per line

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

0.0
/api/src/main/java/org/openmrs/collection/CollectionPart.java
1
/**
2
 * This Source Code Form is subject to the terms of the Mozilla Public License,
3
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
4
 * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
5
 * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
6
 *
7
 * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
8
 * graphic logo is a trademark of OpenMRS Inc.
9
 */
10
package org.openmrs.collection;
11

12
import java.util.Collection;
13

14
import org.apache.commons.lang3.Validate;
15

16
/**
17
 * It is a wrapper for a partial collection, which stores additional info about the current part and
18
 * the whole.
19
 * 
20
 * @since 1.11
21
 */
22
public abstract class CollectionPart<E> {
23
        
24
        private final Long firstElement;
25
        
26
        private final Long maxElements;
27
        
28
        private final Long totalElements;
29
        
30
        private final Boolean totalElementsExact;
31
        
32
        public CollectionPart(Collection<E> collection, Long firstElement, Long maxElements, Long totalElements,
UNCOV
33
            Boolean totalElementsExact) {
×
UNCOV
34
                Validate.notNull(collection);
×
35
                
UNCOV
36
                if (firstElement == null) {
×
UNCOV
37
                        this.firstElement = 0L;
×
38
                } else {
UNCOV
39
                        this.firstElement = firstElement;
×
40
                }
41
                
UNCOV
42
                if (maxElements == null) {
×
UNCOV
43
                        this.maxElements = (long) collection.size();
×
44
                } else {
UNCOV
45
                        this.maxElements = maxElements;
×
46
                }
47
                
UNCOV
48
                this.totalElements = totalElements;
×
49
                
UNCOV
50
                this.totalElementsExact = totalElementsExact;
×
UNCOV
51
        }
×
52
        
53
        public abstract Collection<E> getCollection();
54
        
55
        public Long getFirstElement() {
56
                return firstElement;
×
57
        }
58
        
59
        public Long getMaxElements() {
60
                return maxElements;
×
61
        }
62
        
63
        public Long getTotalElements() {
64
                return totalElements;
×
65
        }
66
        
67
        public boolean isTotalElementsExact() {
68
                return Boolean.TRUE.equals(totalElementsExact);
×
69
        }
70
}
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