• 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

42.97
/src/main/java/org/commonwl/cwlsdk/cwl1_1/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_1;
16

17
import org.commonwl.cwlsdk.cwl1_1.utils.LoaderInstances;
18
import org.commonwl.cwlsdk.cwl1_1.utils.LoadingOptions;
19
import org.commonwl.cwlsdk.cwl1_1.utils.LoadingOptionsBuilder;
20
import org.commonwl.cwlsdk.cwl1_1.utils.SaveableImpl;
21
import org.commonwl.cwlsdk.cwl1_1.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
  </BLOCKQUOTE>
30
 */
31
public class WorkflowOutputParameterImpl extends SaveableImpl implements WorkflowOutputParameter {
32
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
33
  private java.util.Map<String, Object> extensionFields_ =
1✔
34
      new java.util.HashMap<String, Object>();
35
  public LoadingOptions getLoadingOptions() {
NEW
36
    return this.loadingOptions_;
×
37
  }
38
  public java.util.Map<String, Object> getExtensionFields() {
NEW
39
    return this.extensionFields_;
×
40
  }
41

42
  private java.util.Optional<String> id;
43

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

50
  public java.util.Optional<String> getId() {
NEW
51
    return this.id;
×
52
  }
53

54
  private java.util.Optional<String> label;
55

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

62
  public java.util.Optional<String> getLabel() {
NEW
63
    return this.label;
×
64
  }
65

66
  private Object secondaryFiles;
67

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

115
  public Object getSecondaryFiles() {
NEW
116
    return this.secondaryFiles;
×
117
  }
118

119
  private java.util.Optional<Boolean> streamable;
120

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

133
  public java.util.Optional<Boolean> getStreamable() {
NEW
134
    return this.streamable;
×
135
  }
136

137
  private Object doc;
138

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

145
  public Object getDoc() {
NEW
146
    return this.doc;
×
147
  }
148

149
  private Object format;
150

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

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

165
  private Object outputSource;
166

167
  /**
168
   * Getter for property <I>https://w3id.org/cwl/cwl#outputSource</I><BR>
169
   * <BLOCKQUOTE>
170
   * Specifies one or more workflow parameters that supply the value of to
171
   * the output parameter.
172
   *    * </BLOCKQUOTE>
173
   */
174

175
  public Object getOutputSource() {
NEW
176
    return this.outputSource;
×
177
  }
178

179
  private java.util.Optional<LinkMergeMethod> linkMerge;
180

181
  /**
182
   * Getter for property <I>https://w3id.org/cwl/cwl#WorkflowOutputParameter/linkMerge</I><BR>
183
   * <BLOCKQUOTE>
184
   * The method to use to merge multiple sources into a single array.
185
   * If not specified, the default method is "merge_nested".
186
   *    * </BLOCKQUOTE>
187
   */
188

189
  public java.util.Optional<LinkMergeMethod> getLinkMerge() {
NEW
190
    return this.linkMerge;
×
191
  }
192

193
  private Object type;
194

195
  /**
196
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
197
   * <BLOCKQUOTE>
198
   * Specify valid types of data that may be assigned to this parameter.
199
   *    * </BLOCKQUOTE>
200
   */
201

202
  public Object getType() {
NEW
203
    return this.type;
×
204
  }
205

206
  /**
207
   * Used by {@link org.commonwl.cwlsdk.cwl1_1.utils.RootLoader} to construct instances of WorkflowOutputParameterImpl.
208
   *
209
   * @param __doc_            Document fragment to load this record object from (presumably a
210
                              {@link java.util.Map}).
211
   * @param __baseUri_        Base URI to generate child document IDs against.
212
   * @param __loadingOptions  Context for loading URIs and populating objects.
213
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
214
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
215
   *                             or validation of fields fails.
216
   */
217
  public WorkflowOutputParameterImpl(
218
      final Object __doc_,
219
      final String __baseUri_,
220
      LoadingOptions __loadingOptions,
221
      final String __docRoot_) {
222
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
223
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
224
    // generated names.
225
    String __baseUri = __baseUri_;
1✔
226
    String __docRoot = __docRoot_;
1✔
227
    if (!(__doc_ instanceof java.util.Map)) {
1✔
NEW
228
      throw new ValidationException("WorkflowOutputParameterImpl called on non-map");
×
229
    }
230
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
231
    final java.util.List<ValidationException> __errors =
1✔
232
        new java.util.ArrayList<ValidationException>();
233
    if (__loadingOptions != null) {
1✔
234
      this.loadingOptions_ = __loadingOptions;
1✔
235
    }
236
    java.util.Optional<String> id;
237

238
    if (__doc.containsKey("id")) {
1✔
239
      try {
240
        id =
1✔
241
            LoaderInstances
242
                .uri_optional_StringInstance_True_False_None_None
243
                .loadField(__doc.get("id"), __baseUri, __loadingOptions);
1✔
NEW
244
      } catch (ValidationException e) {
×
NEW
245
        id = null; // won't be used but prevents compiler from complaining.
×
NEW
246
        final String __message = "the `id` field is not valid because:";
×
NEW
247
        __errors.add(new ValidationException(__message, e));
×
248
      }
1✔
249

250
    } else {
NEW
251
      id = null;
×
252
    }
253

254
    Boolean __original_is_null = id == null;
1✔
255
    if (id == null) {
1✔
NEW
256
      if (__docRoot != null) {
×
NEW
257
        id = java.util.Optional.of(__docRoot);
×
258
      } else {
NEW
259
        id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
×
260
      }
261
    }
262
    if (__original_is_null) {
1✔
NEW
263
        __baseUri = __baseUri_;
×
264
    } else {
265
        __baseUri = (String) id.orElse(null);
1✔
266
    }
267
    java.util.Optional<String> label;
268

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

281
    } else {
282
      label = null;
1✔
283
    }
284
    Object secondaryFiles;
285

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

298
    } else {
299
      secondaryFiles = null;
1✔
300
    }
301
    java.util.Optional<Boolean> streamable;
302

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

315
    } else {
316
      streamable = null;
1✔
317
    }
318
    Object doc;
319

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

332
    } else {
333
      doc = null;
1✔
334
    }
335
    Object format;
336

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

349
    } else {
350
      format = null;
1✔
351
    }
352
    Object outputSource;
353

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

366
    } else {
NEW
367
      outputSource = null;
×
368
    }
369
    java.util.Optional<LinkMergeMethod> linkMerge;
370

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

383
    } else {
384
      linkMerge = null;
1✔
385
    }
386
    Object type;
387
    try {
388
      type =
1✔
389
          LoaderInstances
390
              .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
391
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
NEW
392
    } catch (ValidationException e) {
×
NEW
393
      type = null; // won't be used but prevents compiler from complaining.
×
NEW
394
      final String __message = "the `type` field is not valid because:";
×
NEW
395
      __errors.add(new ValidationException(__message, e));
×
396
    }
1✔
397
    if (!__errors.isEmpty()) {
1✔
NEW
398
      throw new ValidationException("Trying 'RecordField'", __errors);
×
399
    }
400
    this.label = (java.util.Optional<String>) label;
1✔
401
    this.secondaryFiles = (Object) secondaryFiles;
1✔
402
    this.streamable = (java.util.Optional<Boolean>) streamable;
1✔
403
    this.doc = (Object) doc;
1✔
404
    this.id = (java.util.Optional<String>) id;
1✔
405
    this.format = (Object) format;
1✔
406
    this.outputSource = (Object) outputSource;
1✔
407
    this.linkMerge = (java.util.Optional<LinkMergeMethod>) linkMerge;
1✔
408
    this.type = (Object) type;
1✔
409
    for (String field:__doc.keySet()) {
1✔
410
      if (!attrs.contains(field)) {
1✔
NEW
411
        if (field.contains(":")) {
×
NEW
412
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
413
          extensionFields_.put(expanded_field, __doc.get(field));
×
414
        }
415
      }
416
    }
1✔
417
  }
1✔
418
  private java.util.List<String> attrs = java.util.Arrays.asList("label", "secondaryFiles", "streamable", "doc", "id", "format", "outputSource", "linkMerge", "type");
1✔
419
}
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