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

trydofor / professional-mirana / #112

19 Mar 2025 04:46AM UTC coverage: 87.128% (+2.7%) from 84.4%
#112

push

web-flow
Merge pull request #53 from trydofor/develop

bump 3.0.0 to semver

1645 of 1747 new or added lines in 25 files covered. (94.16%)

2 existing lines in 1 file now uncovered.

7141 of 8196 relevant lines covered (87.13%)

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

3
import org.jetbrains.annotations.Contract;
4
import org.jetbrains.annotations.Nullable;
5
import pro.fessional.mirana.i18n.I18nNotice;
6

7
import java.util.List;
8

9
/**
10
 * <pre>
11
 * - success is false, not complete because of errors
12
 * - code the err-code more than errors
13
 * - errors should null if error is empty
14
 * </pre>
15
 *
16
 * @author trydofor
17
 * @since 2025-01-06
18
 */
19
public interface ErrorResult extends DoneAware, CodeAware {
20

21
    /**
22
     * errors cause success to be false,
23
     * should be null if empty.
24
     */
25
    @Nullable
26
    List<I18nNotice> getErrors();
27

28
    @Contract("true->!null")
29
    default List<I18nNotice> getErrorsIf(boolean nonnull) {
NEW
30
        List<I18nNotice> errors = getErrors();
×
NEW
31
        if (nonnull && errors == null) {
×
NEW
32
            throw new NullPointerException("errors must be nonnull");
×
33
        }
NEW
34
        return errors;
×
35
    }
36

37
    @Contract("!null->!null")
38
    default List<I18nNotice> getErrorsOr(List<I18nNotice> elze) {
NEW
39
        List<I18nNotice> errors = getErrors();
×
NEW
40
        return errors == null ? elze : errors;
×
41
    }
42
}
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