• 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.88
/src/main/java/org/w3id/cwl/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.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#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 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 is the file format that will be assigned to the output
151
   * File object.
152
   *    * </BLOCKQUOTE>
153
   */
154

155
  public Object getFormat() {
156
    return this.format;
×
157
  }
158

159
  private Object type;
160

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

168
  public Object getType() {
169
    return this.type;
×
170
  }
171

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

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

216
    } else {
217
      id = null;
×
218
    }
219

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

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

247
    } else {
248
      label = null;
1✔
249
    }
250
    Object secondaryFiles;
251

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

264
    } else {
265
      secondaryFiles = null;
1✔
266
    }
267
    java.util.Optional<Boolean> streamable;
268

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

281
    } else {
282
      streamable = null;
1✔
283
    }
284
    Object doc;
285

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

298
    } else {
299
      doc = null;
1✔
300
    }
301
    Object format;
302

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

315
    } else {
316
      format = null;
1✔
317
    }
318
    Object type;
319
    try {
320
      type =
1✔
321
          LoaderInstances
322
              .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
323
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
324
    } catch (ValidationException e) {
×
325
      type = null; // won't be used but prevents compiler from complaining.
×
326
      final String __message = "the `type` field is not valid because:";
×
327
      __errors.add(new ValidationException(__message, e));
×
328
    }
1✔
329
    if (!__errors.isEmpty()) {
1✔
330
      throw new ValidationException("Trying 'RecordField'", __errors);
×
331
    }
332
    this.label = (java.util.Optional<String>) label;
1✔
333
    this.secondaryFiles = (Object) secondaryFiles;
1✔
334
    this.streamable = (java.util.Optional<Boolean>) streamable;
1✔
335
    this.doc = (Object) doc;
1✔
336
    this.id = (java.util.Optional<String>) id;
1✔
337
    this.format = (Object) format;
1✔
338
    this.type = (Object) type;
1✔
339
  }
1✔
340
}
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