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

trydofor / professional-mirana / #100

27 Jan 2025 02:41PM UTC coverage: 86.782% (-0.1%) from 86.903%
#100

push

trydofor
♻️ atomic XxxAware static toString of I18nAware #48

6 of 19 new or added lines in 5 files covered. (31.58%)

1 existing line in 1 file now uncovered.

6861 of 7906 relevant lines covered (86.78%)

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/data/DataAware.java
1
package pro.fessional.mirana.data;
2

3

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

7
/**
8
 * @author trydofor
9
 * @since 2025-01-27
10
 */
11
public interface DataAware<T> {
12

13
    /**
14
     * the biz-data to caller
15
     */
16
    @Nullable
17
    T getData();
18

19

20
    @Contract("true->!null")
21
    default T getDataIf(boolean nonnull) {
NEW
22
        T data = getData();
×
NEW
23
        if (nonnull && data == null) {
×
NEW
24
            throw new NullPointerException("data must be nonnull");
×
25
        }
NEW
26
        return data;
×
27
    }
28

29
    @Contract("!null->!null")
30
    default T getDataOr(T elze) {
NEW
31
        T data = getData();
×
NEW
32
        return data == null ? elze : data;
×
33
    }
34
}
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