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

common-workflow-language / cwljava / #394

31 Oct 2025 04:10PM UTC coverage: 57.972% (-1.6%) from 59.538%
#394

push

github

mr-c
rename package to a namespace that we control

7575 of 12994 new or added lines in 261 files covered. (58.3%)

7752 of 13372 relevant lines covered (57.97%)

0.58 hits per line

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

47.56
/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputArraySchemaImpl.java
1
// Copyright Common Workflow Language project contributors
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//      http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15
package org.commonwl.cwlsdk.cwl1_2;
16

17
import org.commonwl.cwlsdk.cwl1_2.utils.LoaderInstances;
18
import org.commonwl.cwlsdk.cwl1_2.utils.LoadingOptions;
19
import org.commonwl.cwlsdk.cwl1_2.utils.LoadingOptionsBuilder;
20
import org.commonwl.cwlsdk.cwl1_2.utils.SaveableImpl;
21
import org.commonwl.cwlsdk.cwl1_2.utils.ValidationException;
22

23
/**
24
* Auto-generated class implementation for <I>https://w3id.org/cwl/cwl#OutputArraySchema</I><BR>
25
 */
26
public class OutputArraySchemaImpl extends SaveableImpl implements OutputArraySchema {
27
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
28
  private java.util.Map<String, Object> extensionFields_ =
1✔
29
      new java.util.HashMap<String, Object>();
30
  public LoadingOptions getLoadingOptions() {
NEW
31
    return this.loadingOptions_;
×
32
  }
33
  public java.util.Map<String, Object> getExtensionFields() {
NEW
34
    return this.extensionFields_;
×
35
  }
36

37
  private java.util.Optional<String> name;
38

39
  /**
40
   * Getter for property <I>https://w3id.org/cwl/cwl#IOSchema/name</I><BR>
41
   * <BLOCKQUOTE>
42
   * The identifier for this type   * </BLOCKQUOTE>
43
   */
44

45
  public java.util.Optional<String> getName() {
NEW
46
    return this.name;
×
47
  }
48

49
  private Object items;
50

51
  /**
52
   * Getter for property <I>https://w3id.org/cwl/salad#items</I><BR>
53
   * <BLOCKQUOTE>
54
   * Defines the type of the array elements.   * </BLOCKQUOTE>
55
   */
56

57
  public Object getItems() {
NEW
58
    return this.items;
×
59
  }
60

61
  private Array_name type;
62

63
  /**
64
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
65
   * <BLOCKQUOTE>
66
   * Must be `array`   * </BLOCKQUOTE>
67
   */
68

69
  public Array_name getType() {
NEW
70
    return this.type;
×
71
  }
72

73
  private java.util.Optional<String> label;
74

75
  /**
76
   * Getter for property <I>https://w3id.org/cwl/cwl#Labeled/label</I><BR>
77
   * <BLOCKQUOTE>
78
   * A short, human-readable label of this object.   * </BLOCKQUOTE>
79
   */
80

81
  public java.util.Optional<String> getLabel() {
NEW
82
    return this.label;
×
83
  }
84

85
  private Object doc;
86

87
  /**
88
   * Getter for property <I>https://w3id.org/cwl/salad#Documented/doc</I><BR>
89
   * <BLOCKQUOTE>
90
   * A documentation string for this object, or an array of strings which should be concatenated.   * </BLOCKQUOTE>
91
   */
92

93
  public Object getDoc() {
NEW
94
    return this.doc;
×
95
  }
96

97
  /**
98
   * Used by {@link org.commonwl.cwlsdk.cwl1_2.utils.RootLoader} to construct instances of OutputArraySchemaImpl.
99
   *
100
   * @param __doc_            Document fragment to load this record object from (presumably a
101
                              {@link java.util.Map}).
102
   * @param __baseUri_        Base URI to generate child document IDs against.
103
   * @param __loadingOptions  Context for loading URIs and populating objects.
104
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
105
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
106
   *                             or validation of fields fails.
107
   */
108
  public OutputArraySchemaImpl(
109
      final Object __doc_,
110
      final String __baseUri_,
111
      LoadingOptions __loadingOptions,
112
      final String __docRoot_) {
113
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
114
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
115
    // generated names.
116
    String __baseUri = __baseUri_;
1✔
117
    String __docRoot = __docRoot_;
1✔
118
    if (!(__doc_ instanceof java.util.Map)) {
1✔
NEW
119
      throw new ValidationException("OutputArraySchemaImpl called on non-map");
×
120
    }
121
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
122
    final java.util.List<ValidationException> __errors =
1✔
123
        new java.util.ArrayList<ValidationException>();
124
    if (__loadingOptions != null) {
1✔
125
      this.loadingOptions_ = __loadingOptions;
1✔
126
    }
127
    java.util.Optional<String> name;
128

129
    if (__doc.containsKey("name")) {
1✔
130
      try {
NEW
131
        name =
×
132
            LoaderInstances
133
                .uri_optional_StringInstance_True_False_None_None
NEW
134
                .loadField(__doc.get("name"), __baseUri, __loadingOptions);
×
NEW
135
      } catch (ValidationException e) {
×
NEW
136
        name = null; // won't be used but prevents compiler from complaining.
×
NEW
137
        final String __message = "the `name` field is not valid because:";
×
NEW
138
        __errors.add(new ValidationException(__message, e));
×
NEW
139
      }
×
140

141
    } else {
142
      name = null;
1✔
143
    }
144

145
    Boolean __original_is_null = name == null;
1✔
146
    if (name == null) {
1✔
147
      if (__docRoot != null) {
1✔
NEW
148
        name = java.util.Optional.of(__docRoot);
×
149
      } else {
150
        name = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
1✔
151
      }
152
    }
153
    if (__original_is_null) {
1✔
154
        __baseUri = __baseUri_;
1✔
155
    } else {
NEW
156
        __baseUri = (String) name.orElse(null);
×
157
    }
158
    Object items;
159
    try {
160
      items =
1✔
161
          LoaderInstances
162
              .uri_union_of_CWLType_or_OutputRecordSchema_or_OutputEnumSchema_or_OutputArraySchema_or_StringInstance_or_array_of_union_of_CWLType_or_OutputRecordSchema_or_OutputEnumSchema_or_OutputArraySchema_or_StringInstance_False_True_2_None
163
              .loadField(__doc.get("items"), __baseUri, __loadingOptions);
1✔
NEW
164
    } catch (ValidationException e) {
×
NEW
165
      items = null; // won't be used but prevents compiler from complaining.
×
NEW
166
      final String __message = "the `items` field is not valid because:";
×
NEW
167
      __errors.add(new ValidationException(__message, e));
×
168
    }
1✔
169
    Array_name type;
170
    try {
171
      type =
1✔
172
          LoaderInstances
173
              .typedsl_Array_name_2
174
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
NEW
175
    } catch (ValidationException e) {
×
NEW
176
      type = null; // won't be used but prevents compiler from complaining.
×
NEW
177
      final String __message = "the `type` field is not valid because:";
×
NEW
178
      __errors.add(new ValidationException(__message, e));
×
179
    }
1✔
180
    java.util.Optional<String> label;
181

182
    if (__doc.containsKey("label")) {
1✔
183
      try {
NEW
184
        label =
×
185
            LoaderInstances
186
                .optional_StringInstance
NEW
187
                .loadField(__doc.get("label"), __baseUri, __loadingOptions);
×
NEW
188
      } catch (ValidationException e) {
×
NEW
189
        label = null; // won't be used but prevents compiler from complaining.
×
NEW
190
        final String __message = "the `label` field is not valid because:";
×
NEW
191
        __errors.add(new ValidationException(__message, e));
×
NEW
192
      }
×
193

194
    } else {
195
      label = null;
1✔
196
    }
197
    Object doc;
198

199
    if (__doc.containsKey("doc")) {
1✔
200
      try {
NEW
201
        doc =
×
202
            LoaderInstances
203
                .union_of_NullInstance_or_StringInstance_or_array_of_StringInstance
NEW
204
                .loadField(__doc.get("doc"), __baseUri, __loadingOptions);
×
NEW
205
      } catch (ValidationException e) {
×
NEW
206
        doc = null; // won't be used but prevents compiler from complaining.
×
NEW
207
        final String __message = "the `doc` field is not valid because:";
×
NEW
208
        __errors.add(new ValidationException(__message, e));
×
NEW
209
      }
×
210

211
    } else {
212
      doc = null;
1✔
213
    }
214
    if (!__errors.isEmpty()) {
1✔
NEW
215
      throw new ValidationException("Trying 'RecordField'", __errors);
×
216
    }
217
    this.items = (Object) items;
1✔
218
    this.type = (Array_name) type;
1✔
219
    this.label = (java.util.Optional<String>) label;
1✔
220
    this.doc = (Object) doc;
1✔
221
    this.name = (java.util.Optional<String>) name;
1✔
222
    for (String field:__doc.keySet()) {
1✔
223
      if (!attrs.contains(field)) {
1✔
NEW
224
        if (field.contains(":")) {
×
NEW
225
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
226
          extensionFields_.put(expanded_field, __doc.get(field));
×
227
        }
228
      }
229
    }
1✔
230
  }
1✔
231
  private java.util.List<String> attrs = java.util.Arrays.asList("items", "type", "label", "doc", "name");
1✔
232
}
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