• 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

51.28
/src/main/java/org/commonwl/cwlsdk/cwl1_1/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_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#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() {
NEW
32
    return this.loadingOptions_;
×
33
  }
34
  public java.util.Map<String, Object> getExtensionFields() {
NEW
35
    return this.extensionFields_;
×
36
  }
37

38
  private java.util.Optional<String> id;
39

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

46
  public java.util.Optional<String> getId() {
NEW
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() {
NEW
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 "null" 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() {
NEW
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() {
NEW
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() {
NEW
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() {
NEW
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() {
NEW
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() {
NEW
183
    return this.outputBinding;
×
184
  }
185

186
  /**
187
   * Used by {@link org.commonwl.cwlsdk.cwl1_1.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✔
NEW
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
    java.util.Optional<String> id;
217

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

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

234
    Boolean __original_is_null = id == null;
1✔
235
    if (id == null) {
1✔
NEW
236
      if (__docRoot != null) {
×
NEW
237
        id = java.util.Optional.of(__docRoot);
×
238
      } else {
NEW
239
        id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
×
240
      }
241
    }
242
    if (__original_is_null) {
1✔
NEW
243
        __baseUri = __baseUri_;
×
244
    } else {
245
        __baseUri = (String) id.orElse(null);
1✔
246
    }
247
    java.util.Optional<String> label;
248

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

261
    } else {
262
      label = null;
1✔
263
    }
264
    Object secondaryFiles;
265

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

278
    } else {
279
      secondaryFiles = null;
1✔
280
    }
281
    java.util.Optional<Boolean> streamable;
282

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

295
    } else {
296
      streamable = null;
1✔
297
    }
298
    Object doc;
299

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

312
    } else {
313
      doc = null;
1✔
314
    }
315
    Object format;
316

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

329
    } else {
330
      format = null;
1✔
331
    }
332
    Object type;
333
    try {
334
      type =
1✔
335
          LoaderInstances
336
              .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
337
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
NEW
338
    } catch (ValidationException e) {
×
NEW
339
      type = null; // won't be used but prevents compiler from complaining.
×
NEW
340
      final String __message = "the `type` field is not valid because:";
×
NEW
341
      __errors.add(new ValidationException(__message, e));
×
342
    }
1✔
343
    java.util.Optional<CommandOutputBinding> outputBinding;
344

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

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

© 2026 Coveralls, Inc