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

trydofor / professional-mirana / #92

26 Jan 2025 09:07AM UTC coverage: 86.903% (-0.5%) from 87.427%
#92

push

trydofor
✨ R.ngError, CodeAware, NameAware #49

0 of 45 new or added lines in 6 files covered. (0.0%)

3 existing lines in 2 files now uncovered.

6861 of 7895 relevant lines covered (86.9%)

0.87 hits per line

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

0.0
/src/main/java/pro/fessional/mirana/i18n/CodeAware.java
1
package pro.fessional.mirana.i18n;
2

3

4
import org.jetbrains.annotations.Contract;
5
import org.jetbrains.annotations.Nullable;
6

7
/**
8
 * @author trydofor
9
 * @since 2025-01-26
10
 */
11
public interface CodeAware {
12

13
    @Nullable
14
    String getCode();
15

16
    @Contract("true->!null")
17
    default String getCodeIf(boolean nonnull) {
NEW
18
        String code = getCode();
×
NEW
19
        if (nonnull && code == null) {
×
NEW
20
            throw new NullPointerException("code must be nonnull");
×
21
        }
NEW
22
        return code;
×
23
    }
24

25
    @Contract("!null->!null")
26
    default String getCodeOr(String elze) {
NEW
27
        String code = getCode();
×
NEW
28
        return code == null ? elze : code;
×
29
    }
30
}
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