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

common-workflow-language / cwljava / #352

07 Apr 2025 10:22AM UTC coverage: 59.538% (-0.6%) from 60.167%
#352

Pull #193

github

web-flow
Merge d636f9333 into 46536cad2
Pull Request #193: Add accessor for the extension field.

0 of 129 new or added lines in 129 files covered. (0.0%)

7347 of 12340 relevant lines covered (59.54%)

0.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

41.98
/src/main/java/org/w3id/cwl/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.w3id.cwl.cwl1_2;
16

17
import org.w3id.cwl.cwl1_2.utils.LoaderInstances;
18
import org.w3id.cwl.cwl1_2.utils.LoadingOptions;
19
import org.w3id.cwl.cwl1_2.utils.LoadingOptionsBuilder;
20
import org.w3id.cwl.cwl1_2.utils.SaveableImpl;
21
import org.w3id.cwl.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 java.util.Map<String, Object> getExtensionFields() {
NEW
33
    return this.extensionFields_;
×
34
  }
35

36
  private java.util.Optional<String> id;
37

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

44
  public java.util.Optional<String> getId() {
45
    return this.id;
×
46
  }
47

48
  private java.util.Optional<String> label;
49

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

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

60
  private Object secondaryFiles;
61

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

109
  public Object getSecondaryFiles() {
110
    return this.secondaryFiles;
×
111
  }
112

113
  private java.util.Optional<Boolean> streamable;
114

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

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

131
  private Object doc;
132

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

139
  public Object getDoc() {
140
    return this.doc;
×
141
  }
142

143
  private Object format;
144

145
  /**
146
   * Getter for property <I>https://w3id.org/cwl/cwl#format</I><BR>
147
   * <BLOCKQUOTE>
148
   * Only valid when `type: File` or is an array of `items: File`.
149
   * 
150
   * This must be one or more IRIs of concept nodes
151
   * that represents file formats which are allowed as input to this
152
   * parameter, preferably defined within an ontology.  If no ontology is
153
   * available, file formats may be tested by exact match.
154
   *    * </BLOCKQUOTE>
155
   */
156

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

161
  private java.util.Optional<Boolean> loadContents;
162

163
  /**
164
   * Getter for property <I>https://w3id.org/cwl/cwl#LoadContents/loadContents</I><BR>
165
   * <BLOCKQUOTE>
166
   * Only valid when `type: File` or is an array of `items: File`.
167
   * 
168
   * If true, the file (or each file in the array) must be a UTF-8
169
   * text file 64 KiB or smaller, and the implementation must read
170
   * the entire contents of the file (or file array) and place it
171
   * in the `contents` field of the File object for use by
172
   * expressions.  If the size of the file is greater than 64 KiB,
173
   * the implementation must raise a fatal error.
174
   *    * </BLOCKQUOTE>
175
   */
176

177
  public java.util.Optional<Boolean> getLoadContents() {
178
    return this.loadContents;
×
179
  }
180

181
  private java.util.Optional<LoadListingEnum> loadListing;
182

183
  /**
184
   * Getter for property <I>https://w3id.org/cwl/cwl#LoadContents/loadListing</I><BR>
185
   * <BLOCKQUOTE>
186
   * Only valid when `type: Directory` or is an array of `items: Directory`.
187
   * 
188
   * Specify the desired behavior for loading the `listing` field of
189
   * a Directory object for use by expressions.
190
   * 
191
   * The order of precedence for loadListing is:
192
   * 
193
   *   1. `loadListing` on an individual parameter
194
   *   2. Inherited from `LoadListingRequirement`
195
   *   3. By default: `no_listing`
196
   *    * </BLOCKQUOTE>
197
   */
198

199
  public java.util.Optional<LoadListingEnum> getLoadListing() {
200
    return this.loadListing;
×
201
  }
202

203
  private java.util.Optional<Object> default_;
204

205
  /**
206
   * Getter for property <I>https://w3id.org/cwl/salad#default</I><BR>
207
   * <BLOCKQUOTE>
208
   * The default value to use for this parameter if the parameter is missing
209
   * from the input object, or if the value of the parameter in the input
210
   * object is `null`.  Default values are applied before evaluating expressions
211
   * (e.g. dependent `valueFrom` fields).
212
   *    * </BLOCKQUOTE>
213
   */
214

215
  public java.util.Optional<Object> getDefault() {
216
    return this.default_;
×
217
  }
218

219
  private Object type;
220

221
  /**
222
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
223
   * <BLOCKQUOTE>
224
   * Specify valid types of data that may be assigned to this parameter.
225
   *    * </BLOCKQUOTE>
226
   */
227

228
  public Object getType() {
229
    return this.type;
×
230
  }
231

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

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

276
    } else {
277
      id = null;
×
278
    }
279

280
    Boolean __original_is_null = id == null;
1✔
281
    if (id == null) {
1✔
282
      if (__docRoot != null) {
×
283
        id = java.util.Optional.of(__docRoot);
×
284
      } else {
285
        id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
×
286
      }
287
    }
288
    if (__original_is_null) {
1✔
289
        __baseUri = __baseUri_;
×
290
    } else {
291
        __baseUri = (String) id.orElse(null);
1✔
292
    }
293
    java.util.Optional<String> label;
294

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

307
    } else {
308
      label = null;
1✔
309
    }
310
    Object secondaryFiles;
311

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

324
    } else {
325
      secondaryFiles = null;
1✔
326
    }
327
    java.util.Optional<Boolean> streamable;
328

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

341
    } else {
342
      streamable = null;
1✔
343
    }
344
    Object doc;
345

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

358
    } else {
359
      doc = null;
1✔
360
    }
361
    Object format;
362

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

375
    } else {
376
      format = null;
1✔
377
    }
378
    java.util.Optional<Boolean> loadContents;
379

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

392
    } else {
393
      loadContents = null;
1✔
394
    }
395
    java.util.Optional<LoadListingEnum> loadListing;
396

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

409
    } else {
410
      loadListing = null;
1✔
411
    }
412
    java.util.Optional<Object> default_;
413

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

426
    } else {
427
      default_ = null;
1✔
428
    }
429
    Object type;
430
    try {
431
      type =
1✔
432
          LoaderInstances
433
              .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
434
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
435
    } catch (ValidationException e) {
×
436
      type = null; // won't be used but prevents compiler from complaining.
×
437
      final String __message = "the `type` field is not valid because:";
×
438
      __errors.add(new ValidationException(__message, e));
×
439
    }
1✔
440
    if (!__errors.isEmpty()) {
1✔
441
      throw new ValidationException("Trying 'RecordField'", __errors);
×
442
    }
443
    this.label = (java.util.Optional<String>) label;
1✔
444
    this.secondaryFiles = (Object) secondaryFiles;
1✔
445
    this.streamable = (java.util.Optional<Boolean>) streamable;
1✔
446
    this.doc = (Object) doc;
1✔
447
    this.id = (java.util.Optional<String>) id;
1✔
448
    this.format = (Object) format;
1✔
449
    this.loadContents = (java.util.Optional<Boolean>) loadContents;
1✔
450
    this.loadListing = (java.util.Optional<LoadListingEnum>) loadListing;
1✔
451
    this.default_ = (java.util.Optional<Object>) default_;
1✔
452
    this.type = (Object) type;
1✔
453
  }
1✔
454
}
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