• 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/NameAware.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 NameAware {
12

13
    @Nullable
14
    String getName();
15

16

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

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