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

common-workflow-language / cwljava / #339

29 Jan 2025 01:23PM UTC coverage: 59.538% (-0.6%) from 60.167%
#339

Pull #193

github

web-flow
Merge 94c260498 into 0978523bc
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

63.22
/src/main/java/org/w3id/cwl/cwl1_2/CommandInputRecordSchemaImpl.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#CommandInputRecordSchema</I><BR>
25
 */
26
public class CommandInputRecordSchemaImpl extends SaveableImpl implements CommandInputRecordSchema {
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 java.util.Optional<String> name;
35

36
  /**
37
   * Getter for property <I>https://w3id.org/cwl/cwl#IOSchema/name</I><BR>
38
   * <BLOCKQUOTE>
39
   * The identifier for this type   * </BLOCKQUOTE>
40
   */
41

42
  public java.util.Optional<String> getName() {
43
    return this.name;
×
44
  }
45

46
  private java.util.Optional<java.util.List<Object>> fields;
47

48
  /**
49
   * Getter for property <I>https://w3id.org/cwl/salad#fields</I><BR>
50
   * <BLOCKQUOTE>
51
   * Defines the fields of the record.   * </BLOCKQUOTE>
52
   */
53

54
  public java.util.Optional<java.util.List<Object>> getFields() {
55
    return this.fields;
×
56
  }
57

58
  private Record_name type;
59

60
  /**
61
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
62
   * <BLOCKQUOTE>
63
   * Must be `record`   * </BLOCKQUOTE>
64
   */
65

66
  public Record_name getType() {
67
    return this.type;
×
68
  }
69

70
  private java.util.Optional<String> label;
71

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

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

82
  private Object doc;
83

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

90
  public Object getDoc() {
91
    return this.doc;
×
92
  }
93

94
  private java.util.Optional<CommandLineBinding> inputBinding;
95

96
  /**
97
   * Getter for property <I>https://w3id.org/cwl/cwl#CommandLineBindable/inputBinding</I><BR>
98
   * <BLOCKQUOTE>
99
   * Describes how to turn this object into command line arguments.   * </BLOCKQUOTE>
100
   */
101

102
  public java.util.Optional<CommandLineBinding> getInputBinding() {
103
    return this.inputBinding;
×
104
  }
105

106
  /**
107
   * Used by {@link org.w3id.cwl.cwl1_2.utils.RootLoader} to construct instances of CommandInputRecordSchemaImpl.
108
   *
109
   * @param __doc_            Document fragment to load this record object from (presumably a
110
                              {@link java.util.Map}).
111
   * @param __baseUri_        Base URI to generate child document IDs against.
112
   * @param __loadingOptions  Context for loading URIs and populating objects.
113
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
114
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
115
   *                             or validation of fields fails.
116
   */
117
  public CommandInputRecordSchemaImpl(
118
      final Object __doc_,
119
      final String __baseUri_,
120
      LoadingOptions __loadingOptions,
121
      final String __docRoot_) {
122
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
123
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
124
    // generated names.
125
    String __baseUri = __baseUri_;
1✔
126
    String __docRoot = __docRoot_;
1✔
127
    if (!(__doc_ instanceof java.util.Map)) {
1✔
128
      throw new ValidationException("CommandInputRecordSchemaImpl called on non-map");
×
129
    }
130
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
131
    final java.util.List<ValidationException> __errors =
1✔
132
        new java.util.ArrayList<ValidationException>();
133
    if (__loadingOptions != null) {
1✔
134
      this.loadingOptions_ = __loadingOptions;
1✔
135
    }
136
    java.util.Optional<String> name;
137

138
    if (__doc.containsKey("name")) {
1✔
139
      try {
140
        name =
1✔
141
            LoaderInstances
142
                .uri_optional_StringInstance_True_False_None_None
143
                .loadField(__doc.get("name"), __baseUri, __loadingOptions);
1✔
144
      } catch (ValidationException e) {
×
145
        name = null; // won't be used but prevents compiler from complaining.
×
146
        final String __message = "the `name` field is not valid because:";
×
147
        __errors.add(new ValidationException(__message, e));
×
148
      }
1✔
149

150
    } else {
151
      name = null;
1✔
152
    }
153

154
    Boolean __original_is_null = name == null;
1✔
155
    if (name == null) {
1✔
156
      if (__docRoot != null) {
1✔
157
        name = java.util.Optional.of(__docRoot);
×
158
      } else {
159
        name = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
1✔
160
      }
161
    }
162
    if (__original_is_null) {
1✔
163
        __baseUri = __baseUri_;
1✔
164
    } else {
165
        __baseUri = (String) name.orElse(null);
1✔
166
    }
167
    java.util.Optional<java.util.List<Object>> fields;
168

169
    if (__doc.containsKey("fields")) {
1✔
170
      try {
171
        fields =
1✔
172
            LoaderInstances
173
                .idmap_fields_optional_array_of_CommandInputRecordField
174
                .loadField(__doc.get("fields"), __baseUri, __loadingOptions);
1✔
175
      } catch (ValidationException e) {
×
176
        fields = null; // won't be used but prevents compiler from complaining.
×
177
        final String __message = "the `fields` field is not valid because:";
×
178
        __errors.add(new ValidationException(__message, e));
×
179
      }
1✔
180

181
    } else {
182
      fields = null;
1✔
183
    }
184
    Record_name type;
185
    try {
186
      type =
1✔
187
          LoaderInstances
188
              .typedsl_Record_name_2
189
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
190
    } catch (ValidationException e) {
1✔
191
      type = null; // won't be used but prevents compiler from complaining.
1✔
192
      final String __message = "the `type` field is not valid because:";
1✔
193
      __errors.add(new ValidationException(__message, e));
1✔
194
    }
1✔
195
    java.util.Optional<String> label;
196

197
    if (__doc.containsKey("label")) {
1✔
198
      try {
199
        label =
×
200
            LoaderInstances
201
                .optional_StringInstance
202
                .loadField(__doc.get("label"), __baseUri, __loadingOptions);
×
203
      } catch (ValidationException e) {
×
204
        label = null; // won't be used but prevents compiler from complaining.
×
205
        final String __message = "the `label` field is not valid because:";
×
206
        __errors.add(new ValidationException(__message, e));
×
207
      }
×
208

209
    } else {
210
      label = null;
1✔
211
    }
212
    Object doc;
213

214
    if (__doc.containsKey("doc")) {
1✔
215
      try {
216
        doc =
1✔
217
            LoaderInstances
218
                .union_of_NullInstance_or_StringInstance_or_array_of_StringInstance
219
                .loadField(__doc.get("doc"), __baseUri, __loadingOptions);
1✔
220
      } catch (ValidationException e) {
×
221
        doc = null; // won't be used but prevents compiler from complaining.
×
222
        final String __message = "the `doc` field is not valid because:";
×
223
        __errors.add(new ValidationException(__message, e));
×
224
      }
1✔
225

226
    } else {
227
      doc = null;
1✔
228
    }
229
    java.util.Optional<CommandLineBinding> inputBinding;
230

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

243
    } else {
244
      inputBinding = null;
1✔
245
    }
246
    if (!__errors.isEmpty()) {
1✔
247
      throw new ValidationException("Trying 'RecordField'", __errors);
1✔
248
    }
249
    this.fields = (java.util.Optional<java.util.List<Object>>) fields;
1✔
250
    this.type = (Record_name) type;
1✔
251
    this.label = (java.util.Optional<String>) label;
1✔
252
    this.doc = (Object) doc;
1✔
253
    this.name = (java.util.Optional<String>) name;
1✔
254
    this.inputBinding = (java.util.Optional<CommandLineBinding>) inputBinding;
1✔
255
  }
1✔
256
}
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