• 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.45
/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() {
NEW
33
    return this.loadingOptions_;
×
34
  }
35
  public java.util.Map<String, Object> getExtensionFields() {
36
    return this.extensionFields_;
×
37
  }
38

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

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

47
  public java.util.Optional<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 "null" 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
    java.util.Optional<String> id;
266

267
    if (__doc.containsKey("id")) {
1✔
268
      try {
269
        id =
1✔
270
            LoaderInstances
271
                .uri_optional_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
    Boolean __original_is_null = id == null;
1✔
284
    if (id == null) {
1✔
285
      if (__docRoot != null) {
×
286
        id = java.util.Optional.of(__docRoot);
×
287
      } else {
288
        id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
×
289
      }
290
    }
291
    if (__original_is_null) {
1✔
292
        __baseUri = __baseUri_;
×
293
    } else {
294
        __baseUri = (String) id.orElse(null);
1✔
295
    }
296
    java.util.Optional<String> label;
297

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

310
    } else {
311
      label = null;
1✔
312
    }
313
    Object secondaryFiles;
314

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

327
    } else {
328
      secondaryFiles = null;
1✔
329
    }
330
    java.util.Optional<Boolean> streamable;
331

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

344
    } else {
345
      streamable = null;
1✔
346
    }
347
    Object doc;
348

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

361
    } else {
362
      doc = null;
1✔
363
    }
364
    Object format;
365

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

378
    } else {
379
      format = null;
1✔
380
    }
381
    java.util.Optional<Boolean> loadContents;
382

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

395
    } else {
396
      loadContents = null;
1✔
397
    }
398
    java.util.Optional<LoadListingEnum> loadListing;
399

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

412
    } else {
413
      loadListing = null;
1✔
414
    }
415
    java.util.Optional<Object> default_;
416

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

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