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

trydofor / professional-wings / #125

31 Aug 2024 04:46AM UTC coverage: 63.579% (+0.7%) from 62.919%
#125

push

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

3.2.130

1428 of 2191 new or added lines in 106 files covered. (65.18%)

41 existing lines in 24 files now uncovered.

12923 of 20326 relevant lines covered (63.58%)

0.64 hits per line

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

66.67
/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/schedule/exec/ExecHolder.java
1
package pro.fessional.wings.tiny.task.schedule.exec;
2

3
import org.apache.commons.lang3.StringUtils;
4
import org.jetbrains.annotations.Contract;
5
import org.jetbrains.annotations.NotNull;
6
import org.jetbrains.annotations.Nullable;
7

8
import java.util.concurrent.ConcurrentHashMap;
9
import java.util.function.Function;
10

11
/**
12
 * @author trydofor
13
 * @since 2022-12-16
14
 */
15
public class ExecHolder {
×
16

17
    private static final ConcurrentHashMap<String, NoticeExec<?>> Notice = new ConcurrentHashMap<>();
1✔
18
    private static final ConcurrentHashMap<String, TaskerExec> Tasker = new ConcurrentHashMap<>();
1✔
19

20
    @NotNull
21
    public static NoticeExec<?> getNotice(@NotNull String bean, @NotNull Function<String, NoticeExec<?>> exec) {
22
        return Notice.computeIfAbsent(bean, exec);
1✔
23
    }
24

25
    @Contract("_,true->!null")
26
    public static NoticeExec<?> getNotice(@Nullable String bean, boolean nonnull) {
27
        final NoticeExec<?> exec = StringUtils.isEmpty(bean) ? null : Notice.get(bean);
1✔
28
        if (nonnull && exec == null) {
1✔
29
            throw new IllegalStateException("notice not found, bean=" + bean);
×
30
        }
31
        return exec;
1✔
32
    }
33

34
    @Nullable
35
    public static NoticeExec<?> delNotice(@NotNull String bean) {
NEW
36
        return Notice.remove(bean);
×
37
    }
38

39

40
    @NotNull
41
    public static TaskerExec getTasker(@NotNull String prop, @NotNull Function<String, TaskerExec> exec) {
42
        return Tasker.computeIfAbsent(prop, exec);
1✔
43
    }
44

45
    @Contract("_,true->!null")
46
    public static TaskerExec getTasker(@Nullable String prop, boolean nonnull) {
47
        final TaskerExec exec = StringUtils.isEmpty(prop) ? null : Tasker.get(prop);
1✔
48
        if (nonnull && exec == null) {
1✔
49
            throw new IllegalStateException("tasker not found, prop=" + prop);
×
50
        }
51
        return exec;
1✔
52
    }
53

54
    @Nullable
55
    public static TaskerExec delTasker(@NotNull String prop) {
NEW
56
        return Tasker.remove(prop);
×
57
    }
58

59
}
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