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

common-workflow-language / cwljava / #336

29 Jan 2025 12:41PM UTC coverage: 60.005% (-2.2%) from 62.203%
#336

Pull #192

github

web-flow
Merge 40f1ed817 into e28b918d2
Pull Request #192: regenerate using latest schema & schema-salad-tool

441 of 968 new or added lines in 65 files covered. (45.56%)

21 existing lines in 3 files now uncovered.

7347 of 12244 relevant lines covered (60.0%)

0.6 hits per line

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

0.0
/src/main/java/org/w3id/cwl/cwl1_1/utils/OneOrListOf.java
1
package org.w3id.cwl.cwl1_1.utils;
2

3
import java.util.List;
4
import java.util.Optional;
5

NEW
6
public class OneOrListOf<T> {
×
7
    private Optional<T> object;
8
    private Optional<List<T>> objects;
9

NEW
10
    private OneOrListOf(final T object, final List<T> objects) {
×
NEW
11
        this.object = Optional.ofNullable(object);
×
NEW
12
        this.objects = Optional.ofNullable(objects);
×
NEW
13
    }
×
14

15
    public static <T> OneOrListOf<T> oneOf(T object) {
NEW
16
        return new OneOrListOf(object, null);
×
17
    }
18

19
    public static <T> OneOrListOf<T> listOf(List<T> objects) {
NEW
20
        assert objects != null;
×
NEW
21
        return new OneOrListOf(null, objects);
×
22
    }
23

24
    public boolean isOne() {
NEW
25
        return this.getOneOptional().isPresent();
×
26
    }
27

28
    public boolean isList() {
NEW
29
        return this.getListOptional().isPresent();
×
30
    }
31

32
    public Optional<T> getOneOptional() {
NEW
33
        return this.object;
×
34
    }
35
    
36
    public Optional<List<T>> getListOptional() {
NEW
37
        return this.objects;
×
38
    }
39

40
    public T getOne() {
NEW
41
        return this.getOneOptional().get();
×
42
    }
43

44
    public List<T> getList() {
NEW
45
        return this.getListOptional().get();
×
46
    }
47

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