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

common-workflow-language / cwljava / #418

08 Dec 2025 09:55AM UTC coverage: 57.962% (-0.01%) from 57.972%
#418

Pull #218

github

web-flow
Merge b21aa5610 into 365de94c4
Pull Request #218: "id" is a required field in for `Parameter`s and `WorkflowStep`s

23 of 43 new or added lines in 12 files covered. (53.49%)

10 existing lines in 10 files now uncovered.

7735 of 13345 relevant lines covered (57.96%)

0.58 hits per line

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

41.91
/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameterImpl.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#OperationInputParameter</I><BR> <BLOCKQUOTE>
25
 Describe an input parameter of an operation.
26
  </BLOCKQUOTE>
27
 */
28
public class OperationInputParameterImpl extends SaveableImpl implements OperationInputParameter {
29
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
30
  private java.util.Map<String, Object> extensionFields_ =
1✔
31
      new java.util.HashMap<String, Object>();
32
  public LoadingOptions getLoadingOptions() {
33
    return this.loadingOptions_;
×
34
  }
35
  public java.util.Map<String, Object> getExtensionFields() {
36
    return this.extensionFields_;
×
37
  }
38

39
  private String id;
40

41
  /**
42
   * Getter for property <I>https://w3id.org/cwl/cwl#Parameter/id</I><BR>
43
   * <BLOCKQUOTE>
44
   * The unique identifier for this Parameter.   * </BLOCKQUOTE>
45
   */
46

47
  public String getId() {
48
    return this.id;
×
49
  }
50

51
  private java.util.Optional<String> label;
52

53
  /**
54
   * Getter for property <I>https://w3id.org/cwl/cwl#Labeled/label</I><BR>
55
   * <BLOCKQUOTE>
56
   * A short, human-readable label of this object.   * </BLOCKQUOTE>
57
   */
58

59
  public java.util.Optional<String> getLabel() {
60
    return this.label;
×
61
  }
62

63
  private Object secondaryFiles;
64

65
  /**
66
   * Getter for property <I>https://w3id.org/cwl/cwl#secondaryFiles</I><BR>
67
   * <BLOCKQUOTE>
68
   * Only valid when `type: File` or is an array of `items: File`.
69
   * 
70
   * Provides a pattern or expression specifying files or
71
   * directories that should be included alongside the primary
72
   * file.  Secondary files may be required or optional.  When not
73
   * explicitly specified, secondary files specified for `inputs`
74
   * are required and `outputs` are optional.  An implementation
75
   * must include matching Files and Directories in the
76
   * `secondaryFiles` property of the primary file.  These Files
77
   * and Directories must be transferred and staged alongside the
78
   * primary file.  An implementation may fail workflow execution
79
   * if a required secondary file does not exist.
80
   * 
81
   * If the value is an expression, the value of `self` in the expression
82
   * must be the primary input or output File object to which this binding
83
   * applies.  The `basename`, `nameroot` and `nameext` fields must be
84
   * present in `self`.  For `CommandLineTool` outputs the `path` field must
85
   * also be present.  The expression must return a filename string relative
86
   * to the path to the primary File, a File or Directory object with either
87
   * `path` or `location` and `basename` fields set, or an array consisting
88
   * of strings or File or Directory objects.  It is legal to reference an
89
   * unchanged File or Directory object taken from input as a secondaryFile.
90
   * The expression may return &quot;null&quot; in which case there is no secondaryFile
91
   * from that expression.
92
   * 
93
   * To work on non-filename-preserving storage systems, portable tool
94
   * descriptions should avoid constructing new values from `location`, but
95
   * should construct relative references using `basename` or `nameroot`
96
   * instead.
97
   * 
98
   * If a value in `secondaryFiles` is a string that is not an expression,
99
   * it specifies that the following pattern should be applied to the path
100
   * of the primary file to yield a filename relative to the primary File:
101
   * 
102
   *   1. If string ends with `?` character, remove the last `?` and mark
103
   *     the resulting secondary file as optional.
104
   *   2. If string begins with one or more caret `^` characters, for each
105
   *     caret, remove the last file extension from the path (the last
106
   *     period `.` and all following characters).  If there are no file
107
   *     extensions, the path is unchanged.
108
   *   3. Append the remainder of the string to the end of the file path.
109
   *    * </BLOCKQUOTE>
110
   */
111

112
  public Object getSecondaryFiles() {
113
    return this.secondaryFiles;
×
114
  }
115

116
  private java.util.Optional<Boolean> streamable;
117

118
  /**
119
   * Getter for property <I>https://w3id.org/cwl/cwl#FieldBase/streamable</I><BR>
120
   * <BLOCKQUOTE>
121
   * Only valid when `type: File` or is an array of `items: File`.
122
   * 
123
   * A value of `true` indicates that the file is read or written
124
   * sequentially without seeking.  An implementation may use this flag to
125
   * indicate whether it is valid to stream file contents using a named
126
   * pipe.  Default: `false`.
127
   *    * </BLOCKQUOTE>
128
   */
129

130
  public java.util.Optional<Boolean> getStreamable() {
131
    return this.streamable;
×
132
  }
133

134
  private Object doc;
135

136
  /**
137
   * Getter for property <I>https://w3id.org/cwl/salad#Documented/doc</I><BR>
138
   * <BLOCKQUOTE>
139
   * A documentation string for this object, or an array of strings which should be concatenated.   * </BLOCKQUOTE>
140
   */
141

142
  public Object getDoc() {
143
    return this.doc;
×
144
  }
145

146
  private Object format;
147

148
  /**
149
   * Getter for property <I>https://w3id.org/cwl/cwl#format</I><BR>
150
   * <BLOCKQUOTE>
151
   * Only valid when `type: File` or is an array of `items: File`.
152
   * 
153
   * This must be one or more IRIs of concept nodes
154
   * that represents file formats which are allowed as input to this
155
   * parameter, preferably defined within an ontology.  If no ontology is
156
   * available, file formats may be tested by exact match.
157
   *    * </BLOCKQUOTE>
158
   */
159

160
  public Object getFormat() {
161
    return this.format;
×
162
  }
163

164
  private java.util.Optional<Boolean> loadContents;
165

166
  /**
167
   * Getter for property <I>https://w3id.org/cwl/cwl#LoadContents/loadContents</I><BR>
168
   * <BLOCKQUOTE>
169
   * Only valid when `type: File` or is an array of `items: File`.
170
   * 
171
   * If true, the file (or each file in the array) must be a UTF-8
172
   * text file 64 KiB or smaller, and the implementation must read
173
   * the entire contents of the file (or file array) and place it
174
   * in the `contents` field of the File object for use by
175
   * expressions.  If the size of the file is greater than 64 KiB,
176
   * the implementation must raise a fatal error.
177
   *    * </BLOCKQUOTE>
178
   */
179

180
  public java.util.Optional<Boolean> getLoadContents() {
181
    return this.loadContents;
×
182
  }
183

184
  private java.util.Optional<LoadListingEnum> loadListing;
185

186
  /**
187
   * Getter for property <I>https://w3id.org/cwl/cwl#LoadContents/loadListing</I><BR>
188
   * <BLOCKQUOTE>
189
   * Only valid when `type: Directory` or is an array of `items: Directory`.
190
   * 
191
   * Specify the desired behavior for loading the `listing` field of
192
   * a Directory object for use by expressions.
193
   * 
194
   * The order of precedence for loadListing is:
195
   * 
196
   *   1. `loadListing` on an individual parameter
197
   *   2. Inherited from `LoadListingRequirement`
198
   *   3. By default: `no_listing`
199
   *    * </BLOCKQUOTE>
200
   */
201

202
  public java.util.Optional<LoadListingEnum> getLoadListing() {
203
    return this.loadListing;
×
204
  }
205

206
  private java.util.Optional<Object> default_;
207

208
  /**
209
   * Getter for property <I>https://w3id.org/cwl/salad#default</I><BR>
210
   * <BLOCKQUOTE>
211
   * The default value to use for this parameter if the parameter is missing
212
   * from the input object, or if the value of the parameter in the input
213
   * object is `null`.  Default values are applied before evaluating expressions
214
   * (e.g. dependent `valueFrom` fields).
215
   *    * </BLOCKQUOTE>
216
   */
217

218
  public java.util.Optional<Object> getDefault() {
219
    return this.default_;
×
220
  }
221

222
  private Object type;
223

224
  /**
225
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
226
   * <BLOCKQUOTE>
227
   * Specify valid types of data that may be assigned to this parameter.
228
   *    * </BLOCKQUOTE>
229
   */
230

231
  public Object getType() {
232
    return this.type;
×
233
  }
234

235
  /**
236
   * Used by {@link org.commonwl.cwlsdk.cwl1_2.utils.RootLoader} to construct instances of OperationInputParameterImpl.
237
   *
238
   * @param __doc_            Document fragment to load this record object from (presumably a
239
                              {@link java.util.Map}).
240
   * @param __baseUri_        Base URI to generate child document IDs against.
241
   * @param __loadingOptions  Context for loading URIs and populating objects.
242
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
243
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
244
   *                             or validation of fields fails.
245
   */
246
  public OperationInputParameterImpl(
247
      final Object __doc_,
248
      final String __baseUri_,
249
      LoadingOptions __loadingOptions,
250
      final String __docRoot_) {
251
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
252
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
253
    // generated names.
254
    String __baseUri = __baseUri_;
1✔
255
    String __docRoot = __docRoot_;
1✔
256
    if (!(__doc_ instanceof java.util.Map)) {
1✔
257
      throw new ValidationException("OperationInputParameterImpl called on non-map");
×
258
    }
259
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
260
    final java.util.List<ValidationException> __errors =
1✔
261
        new java.util.ArrayList<ValidationException>();
262
    if (__loadingOptions != null) {
1✔
263
      this.loadingOptions_ = __loadingOptions;
1✔
264
    }
265
    String id;
266

267
    if (__doc.containsKey("id")) {
1✔
268
      try {
269
        id =
1✔
270
            LoaderInstances
271
                .uri_StringInstance_True_False_None_None
272
                .loadField(__doc.get("id"), __baseUri, __loadingOptions);
1✔
273
      } catch (ValidationException e) {
×
274
        id = null; // won't be used but prevents compiler from complaining.
×
275
        final String __message = "the `id` field is not valid because:";
×
276
        __errors.add(new ValidationException(__message, e));
×
277
      }
1✔
278

279
    } else {
280
      id = null;
×
281
    }
282

283
    if (id == null) {
1✔
UNCOV
284
      if (__docRoot != null) {
×
NEW
285
        id = __docRoot;
×
286
      } else {
NEW
287
        throw new ValidationException("Missing id");
×
288
      }
289
    }
290
    __baseUri = (String) id;
1✔
291
    java.util.Optional<String> label;
292

293
    if (__doc.containsKey("label")) {
1✔
294
      try {
295
        label =
×
296
            LoaderInstances
297
                .optional_StringInstance
298
                .loadField(__doc.get("label"), __baseUri, __loadingOptions);
×
299
      } catch (ValidationException e) {
×
300
        label = null; // won't be used but prevents compiler from complaining.
×
301
        final String __message = "the `label` field is not valid because:";
×
302
        __errors.add(new ValidationException(__message, e));
×
303
      }
×
304

305
    } else {
306
      label = null;
1✔
307
    }
308
    Object secondaryFiles;
309

310
    if (__doc.containsKey("secondaryFiles")) {
1✔
311
      try {
312
        secondaryFiles =
×
313
            LoaderInstances
314
                .secondaryfilesdsl_union_of_NullInstance_or_SecondaryFileSchema_or_array_of_SecondaryFileSchema
315
                .loadField(__doc.get("secondaryFiles"), __baseUri, __loadingOptions);
×
316
      } catch (ValidationException e) {
×
317
        secondaryFiles = null; // won't be used but prevents compiler from complaining.
×
318
        final String __message = "the `secondaryFiles` field is not valid because:";
×
319
        __errors.add(new ValidationException(__message, e));
×
320
      }
×
321

322
    } else {
323
      secondaryFiles = null;
1✔
324
    }
325
    java.util.Optional<Boolean> streamable;
326

327
    if (__doc.containsKey("streamable")) {
1✔
328
      try {
329
        streamable =
×
330
            LoaderInstances
331
                .optional_BooleanInstance
332
                .loadField(__doc.get("streamable"), __baseUri, __loadingOptions);
×
333
      } catch (ValidationException e) {
×
334
        streamable = null; // won't be used but prevents compiler from complaining.
×
335
        final String __message = "the `streamable` field is not valid because:";
×
336
        __errors.add(new ValidationException(__message, e));
×
337
      }
×
338

339
    } else {
340
      streamable = null;
1✔
341
    }
342
    Object doc;
343

344
    if (__doc.containsKey("doc")) {
1✔
345
      try {
346
        doc =
1✔
347
            LoaderInstances
348
                .union_of_NullInstance_or_StringInstance_or_array_of_StringInstance
349
                .loadField(__doc.get("doc"), __baseUri, __loadingOptions);
1✔
350
      } catch (ValidationException e) {
×
351
        doc = null; // won't be used but prevents compiler from complaining.
×
352
        final String __message = "the `doc` field is not valid because:";
×
353
        __errors.add(new ValidationException(__message, e));
×
354
      }
1✔
355

356
    } else {
357
      doc = null;
1✔
358
    }
359
    Object format;
360

361
    if (__doc.containsKey("format")) {
1✔
362
      try {
363
        format =
×
364
            LoaderInstances
365
                .uri_union_of_NullInstance_or_StringInstance_or_array_of_StringInstance_or_ExpressionLoader_True_False_None_True
366
                .loadField(__doc.get("format"), __baseUri, __loadingOptions);
×
367
      } catch (ValidationException e) {
×
368
        format = null; // won't be used but prevents compiler from complaining.
×
369
        final String __message = "the `format` field is not valid because:";
×
370
        __errors.add(new ValidationException(__message, e));
×
371
      }
×
372

373
    } else {
374
      format = null;
1✔
375
    }
376
    java.util.Optional<Boolean> loadContents;
377

378
    if (__doc.containsKey("loadContents")) {
1✔
379
      try {
380
        loadContents =
×
381
            LoaderInstances
382
                .optional_BooleanInstance
383
                .loadField(__doc.get("loadContents"), __baseUri, __loadingOptions);
×
384
      } catch (ValidationException e) {
×
385
        loadContents = null; // won't be used but prevents compiler from complaining.
×
386
        final String __message = "the `loadContents` field is not valid because:";
×
387
        __errors.add(new ValidationException(__message, e));
×
388
      }
×
389

390
    } else {
391
      loadContents = null;
1✔
392
    }
393
    java.util.Optional<LoadListingEnum> loadListing;
394

395
    if (__doc.containsKey("loadListing")) {
1✔
396
      try {
397
        loadListing =
×
398
            LoaderInstances
399
                .optional_LoadListingEnum
400
                .loadField(__doc.get("loadListing"), __baseUri, __loadingOptions);
×
401
      } catch (ValidationException e) {
×
402
        loadListing = null; // won't be used but prevents compiler from complaining.
×
403
        final String __message = "the `loadListing` field is not valid because:";
×
404
        __errors.add(new ValidationException(__message, e));
×
405
      }
×
406

407
    } else {
408
      loadListing = null;
1✔
409
    }
410
    java.util.Optional<Object> default_;
411

412
    if (__doc.containsKey("default")) {
1✔
413
      try {
414
        default_ =
1✔
415
            LoaderInstances
416
                .optional_CWLObjectType
417
                .loadField(__doc.get("default"), __baseUri, __loadingOptions);
1✔
418
      } catch (ValidationException e) {
×
419
        default_ = null; // won't be used but prevents compiler from complaining.
×
420
        final String __message = "the `default` field is not valid because:";
×
421
        __errors.add(new ValidationException(__message, e));
×
422
      }
1✔
423

424
    } else {
425
      default_ = null;
1✔
426
    }
427
    Object type;
428
    try {
429
      type =
1✔
430
          LoaderInstances
431
              .typedsl_union_of_CWLType_or_InputRecordSchema_or_InputEnumSchema_or_InputArraySchema_or_StringInstance_or_array_of_union_of_CWLType_or_InputRecordSchema_or_InputEnumSchema_or_InputArraySchema_or_StringInstance_2
432
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
433
    } catch (ValidationException e) {
×
434
      type = null; // won't be used but prevents compiler from complaining.
×
435
      final String __message = "the `type` field is not valid because:";
×
436
      __errors.add(new ValidationException(__message, e));
×
437
    }
1✔
438
    if (!__errors.isEmpty()) {
1✔
439
      throw new ValidationException("Trying 'RecordField'", __errors);
×
440
    }
441
    this.label = (java.util.Optional<String>) label;
1✔
442
    this.secondaryFiles = (Object) secondaryFiles;
1✔
443
    this.streamable = (java.util.Optional<Boolean>) streamable;
1✔
444
    this.doc = (Object) doc;
1✔
445
    this.id = (String) id;
1✔
446
    this.format = (Object) format;
1✔
447
    this.loadContents = (java.util.Optional<Boolean>) loadContents;
1✔
448
    this.loadListing = (java.util.Optional<LoadListingEnum>) loadListing;
1✔
449
    this.default_ = (java.util.Optional<Object>) default_;
1✔
450
    this.type = (Object) type;
1✔
451
    for (String field:__doc.keySet()) {
1✔
452
      if (!attrs.contains(field)) {
1✔
453
        if (field.contains(":")) {
×
454
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
455
          extensionFields_.put(expanded_field, __doc.get(field));
×
456
        }
457
      }
458
    }
1✔
459
  }
1✔
460
  private java.util.List<String> attrs = java.util.Arrays.asList("label", "secondaryFiles", "streamable", "doc", "id", "format", "loadContents", "loadListing", "default", "type");
1✔
461
}
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