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

common-workflow-language / cwljava / #389

30 Oct 2025 05:13PM UTC coverage: 58.693% (-0.8%) from 59.538%
#389

Pull #218

github

web-flow
Merge 98b159202 into befd7e4b9
Pull Request #218: Populate the extensionFields; add public accessors for LoadingOptions

230 of 569 new or added lines in 67 files covered. (40.42%)

28 existing lines in 27 files now uncovered.

7535 of 12838 relevant lines covered (58.69%)

0.59 hits per line

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

46.67
/src/main/java/org/w3id/cwl/cwl1_2/OperationImpl.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#Operation</I><BR> <BLOCKQUOTE>
25
 This record describes an abstract operation.  It is a potential
26
 step of a workflow that has not yet been bound to a concrete
27
 implementation.  It specifies an input and output signature, but
28
 does not provide enough information to be executed.  An
29
 implementation (or other tooling) may provide a means of binding
30
 an Operation to a concrete process (such as Workflow,
31
 CommandLineTool, or ExpressionTool) with a compatible signature.
32
  </BLOCKQUOTE>
33
 */
34
public class OperationImpl extends SaveableImpl implements Operation {
35
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
36
  private java.util.Map<String, Object> extensionFields_ =
1✔
37
      new java.util.HashMap<String, Object>();
38
  public LoadingOptions getLoadingOptions() {
NEW
39
    return this.loadingOptions_;
×
40
  }
41
  public java.util.Map<String, Object> getExtensionFields() {
42
    return this.extensionFields_;
×
43
  }
44

45
  private java.util.Optional<String> id;
46

47
  /**
48
   * Getter for property <I>https://w3id.org/cwl/cwl#Process/id</I><BR>
49
   * <BLOCKQUOTE>
50
   * The unique identifier for this object.
51
   * 
52
   * Only useful for `$graph` at `Process` level. Should not be exposed
53
   * to users in graphical or terminal user interfaces.
54
   *    * </BLOCKQUOTE>
55
   */
56

57
  public java.util.Optional<String> getId() {
58
    return this.id;
×
59
  }
60

61
  private Operation_class class_;
62

63
  /**
64
   * Getter for property <I>https://w3id.org/cwl/cwl#Operation/class</I><BR>
65

66
   */
67

68
  public Operation_class getClass_() {
69
    return this.class_;
×
70
  }
71

72
  private java.util.Optional<String> label;
73

74
  /**
75
   * Getter for property <I>https://w3id.org/cwl/cwl#Labeled/label</I><BR>
76
   * <BLOCKQUOTE>
77
   * A short, human-readable label of this object.   * </BLOCKQUOTE>
78
   */
79

80
  public java.util.Optional<String> getLabel() {
81
    return this.label;
×
82
  }
83

84
  private Object doc;
85

86
  /**
87
   * Getter for property <I>https://w3id.org/cwl/salad#Documented/doc</I><BR>
88
   * <BLOCKQUOTE>
89
   * A documentation string for this object, or an array of strings which should be concatenated.   * </BLOCKQUOTE>
90
   */
91

92
  public Object getDoc() {
93
    return this.doc;
×
94
  }
95

96
  private java.util.List<Object> inputs;
97

98
  /**
99
   * Getter for property <I>https://w3id.org/cwl/cwl#inputs</I><BR>
100
   * <BLOCKQUOTE>
101
   * Defines the input parameters of the process.  The process is ready to
102
   * run when all required input parameters are associated with concrete
103
   * values.  Input parameters include a schema for each parameter which is
104
   * used to validate the input object.  It may also be used to build a user
105
   * interface for constructing the input object.
106
   * 
107
   * When accepting an input object, all input parameters must have a value.
108
   * If an input parameter is missing from the input object, it must be
109
   * assigned a value of `null` (or the value of `default` for that
110
   * parameter, if provided) for the purposes of validation and evaluation
111
   * of expressions.
112
   *    * </BLOCKQUOTE>
113
   */
114

115
  public java.util.List<Object> getInputs() {
116
    return this.inputs;
×
117
  }
118

119
  private java.util.List<Object> outputs;
120

121
  /**
122
   * Getter for property <I>https://w3id.org/cwl/cwl#outputs</I><BR>
123
   * <BLOCKQUOTE>
124
   * Defines the parameters representing the output of the process.  May be
125
   * used to generate and/or validate the output object.
126
   *    * </BLOCKQUOTE>
127
   */
128

129
  public java.util.List<Object> getOutputs() {
130
    return this.outputs;
×
131
  }
132

133
  private java.util.Optional<java.util.List<Object>> requirements;
134

135
  /**
136
   * Getter for property <I>https://w3id.org/cwl/cwl#requirements</I><BR>
137
   * <BLOCKQUOTE>
138
   * Declares requirements that apply to either the runtime environment or the
139
   * workflow engine that must be met in order to execute this process.  If
140
   * an implementation cannot satisfy all requirements, or a requirement is
141
   * listed which is not recognized by the implementation, it is a fatal
142
   * error and the implementation must not attempt to run the process,
143
   * unless overridden at user option.
144
   *    * </BLOCKQUOTE>
145
   */
146

147
  public java.util.Optional<java.util.List<Object>> getRequirements() {
148
    return this.requirements;
×
149
  }
150

151
  private java.util.Optional<java.util.List<Object>> hints;
152

153
  /**
154
   * Getter for property <I>https://w3id.org/cwl/cwl#hints</I><BR>
155
   * <BLOCKQUOTE>
156
   * Declares hints applying to either the runtime environment or the
157
   * workflow engine that may be helpful in executing this process.  It is
158
   * not an error if an implementation cannot satisfy all hints, however
159
   * the implementation may report a warning.
160
   *    * </BLOCKQUOTE>
161
   */
162

163
  public java.util.Optional<java.util.List<Object>> getHints() {
164
    return this.hints;
×
165
  }
166

167
  private java.util.Optional<CWLVersion> cwlVersion;
168

169
  /**
170
   * Getter for property <I>https://w3id.org/cwl/cwl#cwlVersion</I><BR>
171
   * <BLOCKQUOTE>
172
   * CWL document version. Always required at the document root. Not
173
   * required for a Process embedded inside another Process.
174
   *    * </BLOCKQUOTE>
175
   */
176

177
  public java.util.Optional<CWLVersion> getCwlVersion() {
178
    return this.cwlVersion;
×
179
  }
180

181
  private java.util.Optional<java.util.List<String>> intent;
182

183
  /**
184
   * Getter for property <I>https://w3id.org/cwl/cwl#Process/intent</I><BR>
185
   * <BLOCKQUOTE>
186
   * An identifier for the type of computational operation, of this Process.
187
   * Especially useful for [`Operation`](Workflow.html#Operation), but can also be used for
188
   * [`CommandLineTool`](CommandLineTool.html#CommandLineTool),
189
   * [`Workflow`](Workflow.html#Workflow), or [ExpressionTool](Workflow.html#ExpressionTool).
190
   * 
191
   * If provided, then this must be an IRI of a concept node that
192
   * represents the type of operation, preferably defined within an ontology.
193
   * 
194
   * For example, in the domain of bioinformatics, one can use an IRI from
195
   * the EDAM Ontology's [Operation concept nodes](http://edamontology.org/operation_0004),
196
   * like [Alignment](http://edamontology.org/operation_2928),
197
   * or [Clustering](http://edamontology.org/operation_3432); or a more
198
   * specific Operation concept like
199
   * [Split read mapping](http://edamontology.org/operation_3199).
200
   *    * </BLOCKQUOTE>
201
   */
202

203
  public java.util.Optional<java.util.List<String>> getIntent() {
204
    return this.intent;
×
205
  }
206

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

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

251
    } else {
252
      id = null;
×
253
    }
254

255
    Boolean __original_is_null = id == null;
1✔
256
    if (id == null) {
1✔
257
      if (__docRoot != null) {
×
258
        id = java.util.Optional.of(__docRoot);
×
259
      } else {
260
        id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
×
261
      }
262
    }
263
    if (__original_is_null) {
1✔
264
        __baseUri = __baseUri_;
×
265
    } else {
266
        __baseUri = (String) id.orElse(null);
1✔
267
    }
268
    Operation_class class_;
269
    try {
270
      class_ =
1✔
271
          LoaderInstances
272
              .uri_Operation_class_False_True_None_None
273
              .loadField(__doc.get("class"), __baseUri, __loadingOptions);
1✔
274
    } catch (ValidationException e) {
×
275
      class_ = null; // won't be used but prevents compiler from complaining.
×
276
      final String __message = "the `class` field is not valid because:";
×
277
      __errors.add(new ValidationException(__message, e));
×
278
    }
1✔
279
    java.util.Optional<String> label;
280

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

293
    } else {
294
      label = null;
1✔
295
    }
296
    Object doc;
297

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

310
    } else {
311
      doc = null;
×
312
    }
313
    java.util.List<Object> inputs;
314
    try {
315
      inputs =
1✔
316
          LoaderInstances
317
              .idmap_inputs_array_of_OperationInputParameter
318
              .loadField(__doc.get("inputs"), __baseUri, __loadingOptions);
1✔
319
    } catch (ValidationException e) {
×
320
      inputs = null; // won't be used but prevents compiler from complaining.
×
321
      final String __message = "the `inputs` field is not valid because:";
×
322
      __errors.add(new ValidationException(__message, e));
×
323
    }
1✔
324
    java.util.List<Object> outputs;
325
    try {
326
      outputs =
1✔
327
          LoaderInstances
328
              .idmap_outputs_array_of_OperationOutputParameter
329
              .loadField(__doc.get("outputs"), __baseUri, __loadingOptions);
1✔
330
    } catch (ValidationException e) {
×
331
      outputs = null; // won't be used but prevents compiler from complaining.
×
332
      final String __message = "the `outputs` field is not valid because:";
×
333
      __errors.add(new ValidationException(__message, e));
×
334
    }
1✔
335
    java.util.Optional<java.util.List<Object>> requirements;
336

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

349
    } else {
350
      requirements = null;
1✔
351
    }
352
    java.util.Optional<java.util.List<Object>> hints;
353

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

366
    } else {
367
      hints = null;
1✔
368
    }
369
    java.util.Optional<CWLVersion> cwlVersion;
370

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

383
    } else {
384
      cwlVersion = null;
1✔
385
    }
386
    java.util.Optional<java.util.List<String>> intent;
387

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

400
    } else {
401
      intent = null;
1✔
402
    }
403
    if (!__errors.isEmpty()) {
1✔
404
      throw new ValidationException("Trying 'RecordField'", __errors);
×
405
    }
406
    this.id = (java.util.Optional<String>) id;
1✔
407
    this.label = (java.util.Optional<String>) label;
1✔
408
    this.doc = (Object) doc;
1✔
409
    this.inputs = (java.util.List<Object>) inputs;
1✔
410
    this.outputs = (java.util.List<Object>) outputs;
1✔
411
    this.requirements = (java.util.Optional<java.util.List<Object>>) requirements;
1✔
412
    this.hints = (java.util.Optional<java.util.List<Object>>) hints;
1✔
413
    this.cwlVersion = (java.util.Optional<CWLVersion>) cwlVersion;
1✔
414
    this.intent = (java.util.Optional<java.util.List<String>>) intent;
1✔
415
    this.class_ = (Operation_class) class_;
1✔
416
    for (String field:__doc.keySet()) {
1✔
417
      if (!attrs.contains(field)) {
1✔
NEW
418
        if (field.contains(":")) {
×
NEW
419
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
420
          extensionFields_.put(expanded_field, __doc.get(field));
×
421
        }
422
      }
423
    }
1✔
424
  }
1✔
425
  private java.util.List<String> attrs = java.util.Arrays.asList("id", "label", "doc", "inputs", "outputs", "requirements", "hints", "cwlVersion", "intent", "class");
1✔
426
}
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