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

hazendaz / scriptable-dataset / #124

04 Mar 2024 01:31AM UTC coverage: 89.683% (-0.2%) from 89.922%
#124

push

github

hazendaz
[ci] Modernize the code

23 of 26 branches covered (88.46%)

Branch coverage included in aggregate %.

14 of 14 new or added lines in 2 files covered. (100.0%)

7 existing lines in 3 files now uncovered.

90 of 100 relevant lines covered (90.0%)

0.9 hits per line

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

94.12
/src/main/java/de/gmorling/scriptabledataset/ScriptableDataSetConfig.java
1
/*
2
 * scriptable-dataset (https://github.com/hazendaz/scriptable-dataset)
3
 *
4
 * Copyright 2011-2024 Hazendaz.
5
 *
6
 * All rights reserved. This program and the accompanying materials
7
 * are made available under the terms of The Apache Software License,
8
 * Version 2.0 which accompanies this distribution, and is available at
9
 * https://www.apache.org/licenses/LICENSE-2.0.txt
10
 *
11
 * Contributors:
12
 *     Gunnar Morling
13
 *     Hazendaz (Jeremy Landis).
14
 */
15
package de.gmorling.scriptabledataset;
16

17
import de.gmorling.scriptabledataset.handlers.ScriptInvocationHandler;
18

19
import java.util.ArrayList;
20
import java.util.List;
21
import java.util.Objects;
22

23
import lombok.ToString;
24

25
/**
26
 * Configures the usage of one scripting language with a prefix and a list of invocation handlers.
27
 */
UNCOV
28
@ToString
×
29
public class ScriptableDataSetConfig {
30

31
    /** The prefix. */
32
    private final String prefix;
33

34
    /** The language name. */
35
    private final String languageName;
36

37
    /** The handlers. */
38
    private final List<ScriptInvocationHandler> handlers = new ArrayList<>();
1✔
39

40
    /**
41
     * Creates a new ScriptableDataSetConfig.
42
     *
43
     * @param languageName
44
     *            The name of the language as expected by the JSR 223 scripting engine manager, e.g. "jruby". May not be
45
     *            null.
46
     * @param prefix
47
     *            A prefix, which shall precede fields in a ScriptableDataSet in that language, e.g. "jruby:". May not
48
     *            be null.
49
     */
50
    public ScriptableDataSetConfig(String languageName, String prefix) {
51
        this(languageName, prefix, null);
1✔
52
    }
1✔
53

54
    /**
55
     * Creates a new ScriptableDataSetConfig.
56
     *
57
     * @param languageName
58
     *            The name of the language as expected by the JSR 223 scripting engine manager, e.g. "jruby". May not be
59
     *            null.
60
     * @param prefix
61
     *            A prefix, which shall precede fields in a ScriptableDataSet in that language, e.g. "jruby:". May not
62
     *            be null.
63
     * @param handlers
64
     *            An optional list with handlers to be applied for fields with the given prefix.
65
     */
66
    public ScriptableDataSetConfig(String languageName, String prefix, List<ScriptInvocationHandler> handlers) {
1✔
67

68
        Objects.requireNonNull(languageName);
1✔
69
        Objects.requireNonNull(prefix);
1✔
70

71
        this.prefix = prefix;
1✔
72
        this.languageName = languageName;
1✔
73

74
        if (handlers != null) {
1✔
75
            this.handlers.addAll(handlers);
1✔
76
        }
77
    }
1✔
78

79
    /**
80
     * Gets the prefix.
81
     *
82
     * @return the prefix
83
     */
84
    public String getPrefix() {
85
        return prefix;
1✔
86
    }
87

88
    /**
89
     * Gets the language name.
90
     *
91
     * @return the language name
92
     */
93
    public String getLanguageName() {
94
        return languageName;
1✔
95
    }
96

97
    /**
98
     * Gets the handlers.
99
     *
100
     * @return the handlers
101
     */
102
    public List<ScriptInvocationHandler> getHandlers() {
103
        return handlers;
1✔
104
    }
105

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