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

unitsofmeasurement / indriya / 2289

19 Feb 2025 12:37AM UTC coverage: 71.134% (-0.07%) from 71.202%
2289

push

circleci

keilw
435: AbstractUnit.asType() will accept any si-units as valid class input

Task-Url: https://github.com/unitsofmeasurement/indriya/issues/435

3 of 3 new or added lines in 1 file covered. (100.0%)

2 existing lines in 2 files now uncovered.

3721 of 5231 relevant lines covered (71.13%)

0.71 hits per line

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

75.0
/src/main/java/tech/units/indriya/spi/AbstractSystemOfUnitsService.java
1
/*
2
 * Units of Measurement Reference Implementation
3
 * Copyright (c) 2005-2025, Jean-Marie Dautelle, Werner Keil, Otavio Santana.
4
 *
5
 * All rights reserved.
6
 *
7
 * Redistribution and use in source and binary forms, with or without modification,
8
 * are permitted provided that the following conditions are met:
9
 *
10
 * 1. Redistributions of source code must retain the above copyright notice,
11
 *    this list of conditions and the following disclaimer.
12
 *
13
 * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
14
 *    and the following disclaimer in the documentation and/or other materials provided with the distribution.
15
 *
16
 * 3. Neither the name of JSR-385, Indriya nor the names of their contributors may be used to endorse or promote products
17
 *    derived from this software without specific prior written permission.
18
 *
19
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
package tech.units.indriya.spi;
31

32
import java.util.Collection;
33
import java.util.Map;
34
import java.util.concurrent.ConcurrentHashMap;
35

36
import javax.measure.spi.SystemOfUnits;
37
import javax.measure.spi.SystemOfUnitsService;
38

39
/**
40
 * @author <a href="mailto:werner@units.tech">Werner Keil</a>
41
 * @version 1.1, August 21, 2019
42
 * @since 2.0
43
 */
44
public abstract class AbstractSystemOfUnitsService implements SystemOfUnitsService {
1✔
45
        protected final Map<String, SystemOfUnits> souMap = new ConcurrentHashMap<>();
1✔
46

47
        @Override
48
        public Collection<SystemOfUnits> getAvailableSystemsOfUnits() {
UNCOV
49
                return souMap.values();
×
50
        }
51

52
        @Override
53
        public SystemOfUnits getSystemOfUnits(String name) {
54
                return souMap.get(name);
1✔
55
        }
56
}
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