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

trydofor / professional-mirana / #95

27 Jan 2025 05:46AM UTC coverage: 86.771% (-0.1%) from 86.903%
#95

push

trydofor
♻️ atomic XxxAware #48

0 of 13 new or added lines in 3 files covered. (0.0%)

6861 of 7907 relevant lines covered (86.77%)

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