• 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

43.75
/src/main/java/org/w3id/cwl/cwl1_2/CommandInputRecordFieldImpl.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#CommandInputRecordField</I><BR>
25
 */
26
public class CommandInputRecordFieldImpl extends SaveableImpl implements CommandInputRecordField {
27
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
28
  private java.util.Map<String, Object> extensionFields_ =
1✔
29
      new java.util.HashMap<String, Object>();
30
  public java.util.Map<String, Object> getExtensionFields() {
NEW
31
    return this.extensionFields_;
×
32
  }
33

34
  private String name;
35

36
  /**
37
   * Getter for property <I>https://w3id.org/cwl/salad#RecordField/name</I><BR>
38
   * <BLOCKQUOTE>
39
   * The name of the field
40
   *    * </BLOCKQUOTE>
41
   */
42

43
  public String getName() {
44
    return this.name;
×
45
  }
46

47
  private Object doc;
48

49
  /**
50
   * Getter for property <I>https://w3id.org/cwl/salad#Documented/doc</I><BR>
51
   * <BLOCKQUOTE>
52
   * A documentation string for this object, or an array of strings which should be concatenated.   * </BLOCKQUOTE>
53
   */
54

55
  public Object getDoc() {
56
    return this.doc;
×
57
  }
58

59
  private Object type;
60

61
  /**
62
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
63
   * <BLOCKQUOTE>
64
   * The field type
65
   *    * </BLOCKQUOTE>
66
   */
67

68
  public Object getType() {
69
    return this.type;
×
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 secondaryFiles;
85

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

133
  public Object getSecondaryFiles() {
134
    return this.secondaryFiles;
×
135
  }
136

137
  private java.util.Optional<Boolean> streamable;
138

139
  /**
140
   * Getter for property <I>https://w3id.org/cwl/cwl#FieldBase/streamable</I><BR>
141
   * <BLOCKQUOTE>
142
   * Only valid when `type: File` or is an array of `items: File`.
143
   * 
144
   * A value of `true` indicates that the file is read or written
145
   * sequentially without seeking.  An implementation may use this flag to
146
   * indicate whether it is valid to stream file contents using a named
147
   * pipe.  Default: `false`.
148
   *    * </BLOCKQUOTE>
149
   */
150

151
  public java.util.Optional<Boolean> getStreamable() {
152
    return this.streamable;
×
153
  }
154

155
  private Object format;
156

157
  /**
158
   * Getter for property <I>https://w3id.org/cwl/cwl#format</I><BR>
159
   * <BLOCKQUOTE>
160
   * Only valid when `type: File` or is an array of `items: File`.
161
   * 
162
   * This must be one or more IRIs of concept nodes
163
   * that represents file formats which are allowed as input to this
164
   * parameter, preferably defined within an ontology.  If no ontology is
165
   * available, file formats may be tested by exact match.
166
   *    * </BLOCKQUOTE>
167
   */
168

169
  public Object getFormat() {
170
    return this.format;
×
171
  }
172

173
  private java.util.Optional<Boolean> loadContents;
174

175
  /**
176
   * Getter for property <I>https://w3id.org/cwl/cwl#LoadContents/loadContents</I><BR>
177
   * <BLOCKQUOTE>
178
   * Only valid when `type: File` or is an array of `items: File`.
179
   * 
180
   * If true, the file (or each file in the array) must be a UTF-8
181
   * text file 64 KiB or smaller, and the implementation must read
182
   * the entire contents of the file (or file array) and place it
183
   * in the `contents` field of the File object for use by
184
   * expressions.  If the size of the file is greater than 64 KiB,
185
   * the implementation must raise a fatal error.
186
   *    * </BLOCKQUOTE>
187
   */
188

189
  public java.util.Optional<Boolean> getLoadContents() {
190
    return this.loadContents;
×
191
  }
192

193
  private java.util.Optional<LoadListingEnum> loadListing;
194

195
  /**
196
   * Getter for property <I>https://w3id.org/cwl/cwl#LoadContents/loadListing</I><BR>
197
   * <BLOCKQUOTE>
198
   * Only valid when `type: Directory` or is an array of `items: Directory`.
199
   * 
200
   * Specify the desired behavior for loading the `listing` field of
201
   * a Directory object for use by expressions.
202
   * 
203
   * The order of precedence for loadListing is:
204
   * 
205
   *   1. `loadListing` on an individual parameter
206
   *   2. Inherited from `LoadListingRequirement`
207
   *   3. By default: `no_listing`
208
   *    * </BLOCKQUOTE>
209
   */
210

211
  public java.util.Optional<LoadListingEnum> getLoadListing() {
212
    return this.loadListing;
×
213
  }
214

215
  private java.util.Optional<CommandLineBinding> inputBinding;
216

217
  /**
218
   * Getter for property <I>https://w3id.org/cwl/cwl#CommandLineBindable/inputBinding</I><BR>
219
   * <BLOCKQUOTE>
220
   * Describes how to turn this object into command line arguments.   * </BLOCKQUOTE>
221
   */
222

223
  public java.util.Optional<CommandLineBinding> getInputBinding() {
224
    return this.inputBinding;
×
225
  }
226

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

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

271
    } else {
272
      name = null;
×
273
    }
274

275
    if (name == null) {
1✔
276
      if (__docRoot != null) {
×
277
        name = __docRoot;
×
278
      } else {
279
        throw new ValidationException("Missing name");
×
280
      }
281
    }
282
    __baseUri = (String) name;
1✔
283
    Object doc;
284

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

297
    } else {
298
      doc = null;
1✔
299
    }
300
    Object type;
301
    try {
302
      type =
1✔
303
          LoaderInstances
304
              .typedsl_union_of_CWLType_or_CommandInputRecordSchema_or_CommandInputEnumSchema_or_CommandInputArraySchema_or_StringInstance_or_array_of_union_of_CWLType_or_CommandInputRecordSchema_or_CommandInputEnumSchema_or_CommandInputArraySchema_or_StringInstance_2
305
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
306
    } catch (ValidationException e) {
×
307
      type = null; // won't be used but prevents compiler from complaining.
×
308
      final String __message = "the `type` field is not valid because:";
×
309
      __errors.add(new ValidationException(__message, e));
×
310
    }
1✔
311
    java.util.Optional<String> label;
312

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

325
    } else {
326
      label = null;
1✔
327
    }
328
    Object secondaryFiles;
329

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

342
    } else {
343
      secondaryFiles = null;
1✔
344
    }
345
    java.util.Optional<Boolean> streamable;
346

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

359
    } else {
360
      streamable = null;
1✔
361
    }
362
    Object format;
363

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

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

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

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

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

410
    } else {
411
      loadListing = null;
1✔
412
    }
413
    java.util.Optional<CommandLineBinding> inputBinding;
414

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

427
    } else {
428
      inputBinding = null;
1✔
429
    }
430
    if (!__errors.isEmpty()) {
1✔
431
      throw new ValidationException("Trying 'RecordField'", __errors);
×
432
    }
433
    this.doc = (Object) doc;
1✔
434
    this.name = (String) name;
1✔
435
    this.type = (Object) type;
1✔
436
    this.label = (java.util.Optional<String>) label;
1✔
437
    this.secondaryFiles = (Object) secondaryFiles;
1✔
438
    this.streamable = (java.util.Optional<Boolean>) streamable;
1✔
439
    this.format = (Object) format;
1✔
440
    this.loadContents = (java.util.Optional<Boolean>) loadContents;
1✔
441
    this.loadListing = (java.util.Optional<LoadListingEnum>) loadListing;
1✔
442
    this.inputBinding = (java.util.Optional<CommandLineBinding>) inputBinding;
1✔
443
  }
1✔
444
}
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