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

coditory / quark-uri / #3

pending completion
#3

push

github-actions

ogesaku
init

1212 of 1212 new or added lines in 21 files covered. (100.0%)

926 of 1212 relevant lines covered (76.4%)

0.76 hits per line

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

50.0
/src/main/java/com/coditory/quark/uri/Nullable.java
1
package com.coditory.quark.uri;
2

3
import java.util.function.Consumer;
4
import java.util.function.Function;
5

6
import static com.coditory.quark.uri.Preconditions.expectNonNull;
7

8
final class Nullable {
9
    private Nullable() {
×
10
        throw new UnsupportedOperationException("Do not instantiate utility class");
×
11
    }
12

13
    static <T, R> R mapNotNull(T object, Function<T, R> mapper) {
14
        expectNonNull(mapper, "mapper");
1✔
15
        return object != null
1✔
16
                ? mapper.apply(object)
1✔
17
                : null;
×
18
    }
19

20
    static <T, R> R mapNotNull(T object, Function<T, R> mapper, R defaultValue) {
21
        expectNonNull(mapper, "mapper");
×
22
        return object != null
×
23
                ? mapper.apply(object)
×
24
                : defaultValue;
×
25
    }
26

27
    static <T> void onNotNull(T object, Consumer<T> consumer) {
28
        expectNonNull(consumer, "consumer");
1✔
29
        if (object != null) {
1✔
30
            consumer.accept(object);
1✔
31
        }
32
    }
1✔
33
}
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

© 2025 Coveralls, Inc