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

common-workflow-language / cwljava / #421

16 Dec 2025 08:00PM UTC coverage: 57.962% (-0.01%) from 57.972%
#421

Pull #218

github

web-flow
Merge 0d5009150 into 4d3285bc2
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

53.51
/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameterImpl.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#CommandOutputParameter</I><BR> <BLOCKQUOTE>
25
 An output parameter for a CommandLineTool. </BLOCKQUOTE>
26
 */
27
public class CommandOutputParameterImpl extends SaveableImpl implements CommandOutputParameter {
28
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
29
  private java.util.Map<String, Object> extensionFields_ =
1✔
30
      new java.util.HashMap<String, Object>();
31
  public LoadingOptions getLoadingOptions() {
32
    return this.loadingOptions_;
×
33
  }
34
  public java.util.Map<String, Object> getExtensionFields() {
35
    return this.extensionFields_;
×
36
  }
37

38
  private String id;
39

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

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

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

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

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

62
  private Object secondaryFiles;
63

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

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

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

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

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

133
  private Object doc;
134

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

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

145
  private Object format;
146

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

157
  public Object getFormat() {
158
    return this.format;
×
159
  }
160

161
  private Object type;
162

163
  /**
164
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
165
   * <BLOCKQUOTE>
166
   * Specify valid types of data that may be assigned to this parameter.
167
   *    * </BLOCKQUOTE>
168
   */
169

170
  public Object getType() {
171
    return this.type;
×
172
  }
173

174
  private java.util.Optional<CommandOutputBinding> outputBinding;
175

176
  /**
177
   * Getter for property <I>https://w3id.org/cwl/cwl#CommandOutputParameter/outputBinding</I><BR>
178
   * <BLOCKQUOTE>
179
   * Describes how to generate this output object based on the files produced by a CommandLineTool   * </BLOCKQUOTE>
180
   */
181

182
  public java.util.Optional<CommandOutputBinding> getOutputBinding() {
183
    return this.outputBinding;
×
184
  }
185

186
  /**
187
   * Used by {@link org.commonwl.cwlsdk.cwl1_2.utils.RootLoader} to construct instances of CommandOutputParameterImpl.
188
   *
189
   * @param __doc_            Document fragment to load this record object from (presumably a
190
                              {@link java.util.Map}).
191
   * @param __baseUri_        Base URI to generate child document IDs against.
192
   * @param __loadingOptions  Context for loading URIs and populating objects.
193
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
194
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
195
   *                             or validation of fields fails.
196
   */
197
  public CommandOutputParameterImpl(
198
      final Object __doc_,
199
      final String __baseUri_,
200
      LoadingOptions __loadingOptions,
201
      final String __docRoot_) {
202
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
203
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
204
    // generated names.
205
    String __baseUri = __baseUri_;
1✔
206
    String __docRoot = __docRoot_;
1✔
207
    if (!(__doc_ instanceof java.util.Map)) {
1✔
208
      throw new ValidationException("CommandOutputParameterImpl called on non-map");
×
209
    }
210
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
211
    final java.util.List<ValidationException> __errors =
1✔
212
        new java.util.ArrayList<ValidationException>();
213
    if (__loadingOptions != null) {
1✔
214
      this.loadingOptions_ = __loadingOptions;
1✔
215
    }
216
    String id;
217

218
    if (__doc.containsKey("id")) {
1✔
219
      try {
220
        id =
1✔
221
            LoaderInstances
222
                .uri_StringInstance_True_False_None_None
223
                .loadField(__doc.get("id"), __baseUri, __loadingOptions);
1✔
224
      } catch (ValidationException e) {
×
225
        id = null; // won't be used but prevents compiler from complaining.
×
226
        final String __message = "the `id` field is not valid because:";
×
227
        __errors.add(new ValidationException(__message, e));
×
228
      }
1✔
229

230
    } else {
231
      id = null;
×
232
    }
233

234
    if (id == null) {
1✔
UNCOV
235
      if (__docRoot != null) {
×
NEW
236
        id = __docRoot;
×
237
      } else {
NEW
238
        throw new ValidationException("Missing id");
×
239
      }
240
    }
241
    __baseUri = (String) id;
1✔
242
    java.util.Optional<String> label;
243

244
    if (__doc.containsKey("label")) {
1✔
245
      try {
246
        label =
1✔
247
            LoaderInstances
248
                .optional_StringInstance
249
                .loadField(__doc.get("label"), __baseUri, __loadingOptions);
1✔
250
      } catch (ValidationException e) {
×
251
        label = null; // won't be used but prevents compiler from complaining.
×
252
        final String __message = "the `label` field is not valid because:";
×
253
        __errors.add(new ValidationException(__message, e));
×
254
      }
1✔
255

256
    } else {
257
      label = null;
1✔
258
    }
259
    Object secondaryFiles;
260

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

273
    } else {
274
      secondaryFiles = null;
1✔
275
    }
276
    java.util.Optional<Boolean> streamable;
277

278
    if (__doc.containsKey("streamable")) {
1✔
279
      try {
280
        streamable =
×
281
            LoaderInstances
282
                .optional_BooleanInstance
283
                .loadField(__doc.get("streamable"), __baseUri, __loadingOptions);
×
284
      } catch (ValidationException e) {
×
285
        streamable = null; // won't be used but prevents compiler from complaining.
×
286
        final String __message = "the `streamable` field is not valid because:";
×
287
        __errors.add(new ValidationException(__message, e));
×
288
      }
×
289

290
    } else {
291
      streamable = null;
1✔
292
    }
293
    Object doc;
294

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

307
    } else {
308
      doc = null;
1✔
309
    }
310
    Object format;
311

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

324
    } else {
325
      format = null;
1✔
326
    }
327
    Object type;
328
    try {
329
      type =
1✔
330
          LoaderInstances
331
              .typedsl_union_of_CWLType_or_stdout_or_stderr_or_CommandOutputRecordSchema_or_CommandOutputEnumSchema_or_CommandOutputArraySchema_or_StringInstance_or_array_of_union_of_CWLType_or_CommandOutputRecordSchema_or_CommandOutputEnumSchema_or_CommandOutputArraySchema_or_StringInstance_2
332
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
333
    } catch (ValidationException e) {
×
334
      type = null; // won't be used but prevents compiler from complaining.
×
335
      final String __message = "the `type` field is not valid because:";
×
336
      __errors.add(new ValidationException(__message, e));
×
337
    }
1✔
338
    java.util.Optional<CommandOutputBinding> outputBinding;
339

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

352
    } else {
353
      outputBinding = null;
1✔
354
    }
355
    if (!__errors.isEmpty()) {
1✔
356
      throw new ValidationException("Trying 'RecordField'", __errors);
×
357
    }
358
    this.label = (java.util.Optional<String>) label;
1✔
359
    this.secondaryFiles = (Object) secondaryFiles;
1✔
360
    this.streamable = (java.util.Optional<Boolean>) streamable;
1✔
361
    this.doc = (Object) doc;
1✔
362
    this.id = (String) id;
1✔
363
    this.format = (Object) format;
1✔
364
    this.type = (Object) type;
1✔
365
    this.outputBinding = (java.util.Optional<CommandOutputBinding>) outputBinding;
1✔
366
    for (String field:__doc.keySet()) {
1✔
367
      if (!attrs.contains(field)) {
1✔
368
        if (field.contains(":")) {
1✔
369
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
370
          extensionFields_.put(expanded_field, __doc.get(field));
×
371
        }
372
      }
373
    }
1✔
374
  }
1✔
375
  private java.util.List<String> attrs = java.util.Arrays.asList("label", "secondaryFiles", "streamable", "doc", "id", "format", "type", "outputBinding");
1✔
376
}
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