• 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

46.76
/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameterImpl.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#WorkflowOutputParameter</I><BR> <BLOCKQUOTE>
25
 Describe an output parameter of a workflow.  The parameter must be
26
 connected to one or more parameters defined in the workflow that
27
 will provide the value of the output parameter. It is legal to
28
 connect a WorkflowInputParameter to a WorkflowOutputParameter.
29
 
30
 See [WorkflowStepInput](#WorkflowStepInput) for discussion of
31
 `linkMerge` and `pickValue`.
32
  </BLOCKQUOTE>
33
 */
34
public class WorkflowOutputParameterImpl extends SaveableImpl implements WorkflowOutputParameter {
35
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
36
  private java.util.Map<String, Object> extensionFields_ =
1✔
37
      new java.util.HashMap<String, Object>();
38
  public LoadingOptions getLoadingOptions() {
NEW
39
    return this.loadingOptions_;
×
40
  }
41
  public java.util.Map<String, Object> getExtensionFields() {
NEW
42
    return this.extensionFields_;
×
43
  }
44

45
  private java.util.Optional<String> id;
46

47
  /**
48
   * Getter for property <I>https://w3id.org/cwl/cwl#Identified/id</I><BR>
49
   * <BLOCKQUOTE>
50
   * The unique identifier for this object.   * </BLOCKQUOTE>
51
   */
52

53
  public java.util.Optional<String> getId() {
NEW
54
    return this.id;
×
55
  }
56

57
  private java.util.Optional<String> label;
58

59
  /**
60
   * Getter for property <I>https://w3id.org/cwl/cwl#Labeled/label</I><BR>
61
   * <BLOCKQUOTE>
62
   * A short, human-readable label of this object.   * </BLOCKQUOTE>
63
   */
64

65
  public java.util.Optional<String> getLabel() {
NEW
66
    return this.label;
×
67
  }
68

69
  private Object secondaryFiles;
70

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

118
  public Object getSecondaryFiles() {
NEW
119
    return this.secondaryFiles;
×
120
  }
121

122
  private java.util.Optional<Boolean> streamable;
123

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

136
  public java.util.Optional<Boolean> getStreamable() {
NEW
137
    return this.streamable;
×
138
  }
139

140
  private Object doc;
141

142
  /**
143
   * Getter for property <I>https://w3id.org/cwl/salad#Documented/doc</I><BR>
144
   * <BLOCKQUOTE>
145
   * A documentation string for this object, or an array of strings which should be concatenated.   * </BLOCKQUOTE>
146
   */
147

148
  public Object getDoc() {
NEW
149
    return this.doc;
×
150
  }
151

152
  private Object format;
153

154
  /**
155
   * Getter for property <I>https://w3id.org/cwl/cwl#format</I><BR>
156
   * <BLOCKQUOTE>
157
   * Only valid when `type: File` or is an array of `items: File`.
158
   * 
159
   * This is the file format that will be assigned to the output
160
   * File object.
161
   *    * </BLOCKQUOTE>
162
   */
163

164
  public Object getFormat() {
NEW
165
    return this.format;
×
166
  }
167

168
  private Object outputSource;
169

170
  /**
171
   * Getter for property <I>https://w3id.org/cwl/cwl#outputSource</I><BR>
172
   * <BLOCKQUOTE>
173
   * Specifies one or more names of an output from a workflow step (in the form
174
   * `step_name/output_name` with a `/` separator`), or a workflow input name,
175
   * that supply their value(s) to the output parameter.
176
   * the output parameter.  It is valid to reference workflow level inputs
177
   * here.
178
   *    * </BLOCKQUOTE>
179
   */
180

181
  public Object getOutputSource() {
NEW
182
    return this.outputSource;
×
183
  }
184

185
  private java.util.Optional<LinkMergeMethod> linkMerge;
186

187
  /**
188
   * Getter for property <I>https://w3id.org/cwl/cwl#WorkflowOutputParameter/linkMerge</I><BR>
189
   * <BLOCKQUOTE>
190
   * The method to use to merge multiple sources into a single array.
191
   * If not specified, the default method is "merge_nested".
192
   *    * </BLOCKQUOTE>
193
   */
194

195
  public java.util.Optional<LinkMergeMethod> getLinkMerge() {
NEW
196
    return this.linkMerge;
×
197
  }
198

199
  private java.util.Optional<PickValueMethod> pickValue;
200

201
  /**
202
   * Getter for property <I>https://w3id.org/cwl/cwl#WorkflowOutputParameter/pickValue</I><BR>
203
   * <BLOCKQUOTE>
204
   * The method to use to choose non-null elements among multiple sources.
205
   *    * </BLOCKQUOTE>
206
   */
207

208
  public java.util.Optional<PickValueMethod> getPickValue() {
NEW
209
    return this.pickValue;
×
210
  }
211

212
  private Object type;
213

214
  /**
215
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
216
   * <BLOCKQUOTE>
217
   * Specify valid types of data that may be assigned to this parameter.
218
   *    * </BLOCKQUOTE>
219
   */
220

221
  public Object getType() {
NEW
222
    return this.type;
×
223
  }
224

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

257
    if (__doc.containsKey("id")) {
1✔
258
      try {
259
        id =
1✔
260
            LoaderInstances
261
                .uri_optional_StringInstance_True_False_None_None
262
                .loadField(__doc.get("id"), __baseUri, __loadingOptions);
1✔
NEW
263
      } catch (ValidationException e) {
×
NEW
264
        id = null; // won't be used but prevents compiler from complaining.
×
NEW
265
        final String __message = "the `id` field is not valid because:";
×
NEW
266
        __errors.add(new ValidationException(__message, e));
×
267
      }
1✔
268

269
    } else {
NEW
270
      id = null;
×
271
    }
272

273
    Boolean __original_is_null = id == null;
1✔
274
    if (id == null) {
1✔
NEW
275
      if (__docRoot != null) {
×
NEW
276
        id = java.util.Optional.of(__docRoot);
×
277
      } else {
NEW
278
        id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
×
279
      }
280
    }
281
    if (__original_is_null) {
1✔
NEW
282
        __baseUri = __baseUri_;
×
283
    } else {
284
        __baseUri = (String) id.orElse(null);
1✔
285
    }
286
    java.util.Optional<String> label;
287

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

300
    } else {
301
      label = null;
1✔
302
    }
303
    Object secondaryFiles;
304

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

317
    } else {
318
      secondaryFiles = null;
1✔
319
    }
320
    java.util.Optional<Boolean> streamable;
321

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

334
    } else {
335
      streamable = null;
1✔
336
    }
337
    Object doc;
338

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

351
    } else {
352
      doc = null;
1✔
353
    }
354
    Object format;
355

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

368
    } else {
369
      format = null;
1✔
370
    }
371
    Object outputSource;
372

373
    if (__doc.containsKey("outputSource")) {
1✔
374
      try {
375
        outputSource =
1✔
376
            LoaderInstances
377
                .uri_union_of_NullInstance_or_StringInstance_or_array_of_StringInstance_False_False_1_None
378
                .loadField(__doc.get("outputSource"), __baseUri, __loadingOptions);
1✔
NEW
379
      } catch (ValidationException e) {
×
NEW
380
        outputSource = null; // won't be used but prevents compiler from complaining.
×
NEW
381
        final String __message = "the `outputSource` field is not valid because:";
×
NEW
382
        __errors.add(new ValidationException(__message, e));
×
383
      }
1✔
384

385
    } else {
386
      outputSource = null;
1✔
387
    }
388
    java.util.Optional<LinkMergeMethod> linkMerge;
389

390
    if (__doc.containsKey("linkMerge")) {
1✔
391
      try {
392
        linkMerge =
1✔
393
            LoaderInstances
394
                .optional_LinkMergeMethod
395
                .loadField(__doc.get("linkMerge"), __baseUri, __loadingOptions);
1✔
NEW
396
      } catch (ValidationException e) {
×
NEW
397
        linkMerge = null; // won't be used but prevents compiler from complaining.
×
NEW
398
        final String __message = "the `linkMerge` field is not valid because:";
×
NEW
399
        __errors.add(new ValidationException(__message, e));
×
400
      }
1✔
401

402
    } else {
403
      linkMerge = null;
1✔
404
    }
405
    java.util.Optional<PickValueMethod> pickValue;
406

407
    if (__doc.containsKey("pickValue")) {
1✔
408
      try {
409
        pickValue =
1✔
410
            LoaderInstances
411
                .optional_PickValueMethod
412
                .loadField(__doc.get("pickValue"), __baseUri, __loadingOptions);
1✔
NEW
413
      } catch (ValidationException e) {
×
NEW
414
        pickValue = null; // won't be used but prevents compiler from complaining.
×
NEW
415
        final String __message = "the `pickValue` field is not valid because:";
×
NEW
416
        __errors.add(new ValidationException(__message, e));
×
417
      }
1✔
418

419
    } else {
420
      pickValue = null;
1✔
421
    }
422
    Object type;
423
    try {
424
      type =
1✔
425
          LoaderInstances
426
              .typedsl_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_2
427
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
NEW
428
    } catch (ValidationException e) {
×
NEW
429
      type = null; // won't be used but prevents compiler from complaining.
×
NEW
430
      final String __message = "the `type` field is not valid because:";
×
NEW
431
      __errors.add(new ValidationException(__message, e));
×
432
    }
1✔
433
    if (!__errors.isEmpty()) {
1✔
NEW
434
      throw new ValidationException("Trying 'RecordField'", __errors);
×
435
    }
436
    this.label = (java.util.Optional<String>) label;
1✔
437
    this.secondaryFiles = (Object) secondaryFiles;
1✔
438
    this.streamable = (java.util.Optional<Boolean>) streamable;
1✔
439
    this.doc = (Object) doc;
1✔
440
    this.id = (java.util.Optional<String>) id;
1✔
441
    this.format = (Object) format;
1✔
442
    this.outputSource = (Object) outputSource;
1✔
443
    this.linkMerge = (java.util.Optional<LinkMergeMethod>) linkMerge;
1✔
444
    this.pickValue = (java.util.Optional<PickValueMethod>) pickValue;
1✔
445
    this.type = (Object) type;
1✔
446
    for (String field:__doc.keySet()) {
1✔
447
      if (!attrs.contains(field)) {
1✔
NEW
448
        if (field.contains(":")) {
×
NEW
449
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
450
          extensionFields_.put(expanded_field, __doc.get(field));
×
451
        }
452
      }
453
    }
1✔
454
  }
1✔
455
  private java.util.List<String> attrs = java.util.Arrays.asList("label", "secondaryFiles", "streamable", "doc", "id", "format", "outputSource", "linkMerge", "pickValue", "type");
1✔
456
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc