• 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

44.34
/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameterImpl.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#OperationOutputParameter</I><BR> <BLOCKQUOTE>
25
 Describe an output parameter of an operation.
26
  </BLOCKQUOTE>
27
 */
28
public class OperationOutputParameterImpl extends SaveableImpl implements OperationOutputParameter {
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 is the file format that will be assigned to the output
154
   * File object.
155
   *    * </BLOCKQUOTE>
156
   */
157

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

162
  private Object type;
163

164
  /**
165
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
166
   * <BLOCKQUOTE>
167
   * Specify valid types of data that may be assigned to this parameter.
168
   *    * </BLOCKQUOTE>
169
   */
170

171
  public Object getType() {
172
    return this.type;
×
173
  }
174

175
  /**
176
   * Used by {@link org.commonwl.cwlsdk.cwl1_2.utils.RootLoader} to construct instances of OperationOutputParameterImpl.
177
   *
178
   * @param __doc_            Document fragment to load this record object from (presumably a
179
                              {@link java.util.Map}).
180
   * @param __baseUri_        Base URI to generate child document IDs against.
181
   * @param __loadingOptions  Context for loading URIs and populating objects.
182
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
183
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
184
   *                             or validation of fields fails.
185
   */
186
  public OperationOutputParameterImpl(
187
      final Object __doc_,
188
      final String __baseUri_,
189
      LoadingOptions __loadingOptions,
190
      final String __docRoot_) {
191
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
192
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
193
    // generated names.
194
    String __baseUri = __baseUri_;
1✔
195
    String __docRoot = __docRoot_;
1✔
196
    if (!(__doc_ instanceof java.util.Map)) {
1✔
197
      throw new ValidationException("OperationOutputParameterImpl called on non-map");
×
198
    }
199
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
200
    final java.util.List<ValidationException> __errors =
1✔
201
        new java.util.ArrayList<ValidationException>();
202
    if (__loadingOptions != null) {
1✔
203
      this.loadingOptions_ = __loadingOptions;
1✔
204
    }
205
    java.util.Optional<String> id;
206

207
    if (__doc.containsKey("id")) {
1✔
208
      try {
209
        id =
1✔
210
            LoaderInstances
211
                .uri_optional_StringInstance_True_False_None_None
212
                .loadField(__doc.get("id"), __baseUri, __loadingOptions);
1✔
213
      } catch (ValidationException e) {
×
214
        id = null; // won't be used but prevents compiler from complaining.
×
215
        final String __message = "the `id` field is not valid because:";
×
216
        __errors.add(new ValidationException(__message, e));
×
217
      }
1✔
218

219
    } else {
220
      id = null;
×
221
    }
222

223
    Boolean __original_is_null = id == null;
1✔
224
    if (id == null) {
1✔
225
      if (__docRoot != null) {
×
226
        id = java.util.Optional.of(__docRoot);
×
227
      } else {
228
        id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
×
229
      }
230
    }
231
    if (__original_is_null) {
1✔
232
        __baseUri = __baseUri_;
×
233
    } else {
234
        __baseUri = (String) id.orElse(null);
1✔
235
    }
236
    java.util.Optional<String> label;
237

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

250
    } else {
251
      label = null;
1✔
252
    }
253
    Object secondaryFiles;
254

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

267
    } else {
268
      secondaryFiles = null;
1✔
269
    }
270
    java.util.Optional<Boolean> streamable;
271

272
    if (__doc.containsKey("streamable")) {
1✔
273
      try {
274
        streamable =
×
275
            LoaderInstances
276
                .optional_BooleanInstance
277
                .loadField(__doc.get("streamable"), __baseUri, __loadingOptions);
×
278
      } catch (ValidationException e) {
×
279
        streamable = null; // won't be used but prevents compiler from complaining.
×
280
        final String __message = "the `streamable` field is not valid because:";
×
281
        __errors.add(new ValidationException(__message, e));
×
282
      }
×
283

284
    } else {
285
      streamable = null;
1✔
286
    }
287
    Object doc;
288

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

301
    } else {
302
      doc = null;
1✔
303
    }
304
    Object format;
305

306
    if (__doc.containsKey("format")) {
1✔
307
      try {
308
        format =
×
309
            LoaderInstances
310
                .uri_union_of_NullInstance_or_StringInstance_or_ExpressionLoader_True_False_None_True
311
                .loadField(__doc.get("format"), __baseUri, __loadingOptions);
×
312
      } catch (ValidationException e) {
×
313
        format = null; // won't be used but prevents compiler from complaining.
×
314
        final String __message = "the `format` field is not valid because:";
×
315
        __errors.add(new ValidationException(__message, e));
×
316
      }
×
317

318
    } else {
319
      format = null;
1✔
320
    }
321
    Object type;
322
    try {
323
      type =
1✔
324
          LoaderInstances
325
              .typedsl_union_of_CWLType_or_OutputRecordSchema_or_OutputEnumSchema_or_OutputArraySchema_or_StringInstance_or_array_of_union_of_CWLType_or_OutputRecordSchema_or_OutputEnumSchema_or_OutputArraySchema_or_StringInstance_2
326
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
327
    } catch (ValidationException e) {
×
328
      type = null; // won't be used but prevents compiler from complaining.
×
329
      final String __message = "the `type` field is not valid because:";
×
330
      __errors.add(new ValidationException(__message, e));
×
331
    }
1✔
332
    if (!__errors.isEmpty()) {
1✔
333
      throw new ValidationException("Trying 'RecordField'", __errors);
×
334
    }
335
    this.label = (java.util.Optional<String>) label;
1✔
336
    this.secondaryFiles = (Object) secondaryFiles;
1✔
337
    this.streamable = (java.util.Optional<Boolean>) streamable;
1✔
338
    this.doc = (Object) doc;
1✔
339
    this.id = (java.util.Optional<String>) id;
1✔
340
    this.format = (Object) format;
1✔
341
    this.type = (Object) type;
1✔
342
    for (String field:__doc.keySet()) {
1✔
343
      if (!attrs.contains(field)) {
1✔
NEW
344
        if (field.contains(":")) {
×
NEW
345
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
346
          extensionFields_.put(expanded_field, __doc.get(field));
×
347
        }
348
      }
349
    }
1✔
350
  }
1✔
351
  private java.util.List<String> attrs = java.util.Arrays.asList("label", "secondaryFiles", "streamable", "doc", "id", "format", "type");
1✔
352
}
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