• 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

60.53
/src/main/java/org/w3id/cwl/cwl1_1/CommandOutputRecordSchemaImpl.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_1;
16

17
import org.w3id.cwl.cwl1_1.utils.LoaderInstances;
18
import org.w3id.cwl.cwl1_1.utils.LoadingOptions;
19
import org.w3id.cwl.cwl1_1.utils.LoadingOptionsBuilder;
20
import org.w3id.cwl.cwl1_1.utils.SaveableImpl;
21
import org.w3id.cwl.cwl1_1.utils.ValidationException;
22

23
/**
24
* Auto-generated class implementation for <I>https://w3id.org/cwl/cwl#CommandOutputRecordSchema</I><BR>
25
 */
26
public class CommandOutputRecordSchemaImpl extends SaveableImpl implements CommandOutputRecordSchema {
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
  /**
95
   * Used by {@link org.w3id.cwl.cwl1_1.utils.RootLoader} to construct instances of CommandOutputRecordSchemaImpl.
96
   *
97
   * @param __doc_            Document fragment to load this record object from (presumably a
98
                              {@link java.util.Map}).
99
   * @param __baseUri_        Base URI to generate child document IDs against.
100
   * @param __loadingOptions  Context for loading URIs and populating objects.
101
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
102
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
103
   *                             or validation of fields fails.
104
   */
105
  public CommandOutputRecordSchemaImpl(
106
      final Object __doc_,
107
      final String __baseUri_,
108
      LoadingOptions __loadingOptions,
109
      final String __docRoot_) {
110
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
111
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
112
    // generated names.
113
    String __baseUri = __baseUri_;
1✔
114
    String __docRoot = __docRoot_;
1✔
115
    if (!(__doc_ instanceof java.util.Map)) {
1✔
116
      throw new ValidationException("CommandOutputRecordSchemaImpl called on non-map");
×
117
    }
118
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
119
    final java.util.List<ValidationException> __errors =
1✔
120
        new java.util.ArrayList<ValidationException>();
121
    if (__loadingOptions != null) {
1✔
122
      this.loadingOptions_ = __loadingOptions;
1✔
123
    }
124
    java.util.Optional<String> name;
125

126
    if (__doc.containsKey("name")) {
1✔
127
      try {
128
        name =
1✔
129
            LoaderInstances
130
                .uri_optional_StringInstance_True_False_None_None
131
                .loadField(__doc.get("name"), __baseUri, __loadingOptions);
1✔
132
      } catch (ValidationException e) {
×
133
        name = null; // won't be used but prevents compiler from complaining.
×
134
        final String __message = "the `name` field is not valid because:";
×
135
        __errors.add(new ValidationException(__message, e));
×
136
      }
1✔
137

138
    } else {
139
      name = null;
1✔
140
    }
141

142
    Boolean __original_is_null = name == null;
1✔
143
    if (name == null) {
1✔
144
      if (__docRoot != null) {
1✔
145
        name = java.util.Optional.of(__docRoot);
×
146
      } else {
147
        name = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
1✔
148
      }
149
    }
150
    if (__original_is_null) {
1✔
151
        __baseUri = __baseUri_;
1✔
152
    } else {
153
        __baseUri = (String) name.orElse(null);
1✔
154
    }
155
    java.util.Optional<java.util.List<Object>> fields;
156

157
    if (__doc.containsKey("fields")) {
1✔
158
      try {
159
        fields =
1✔
160
            LoaderInstances
161
                .idmap_fields_optional_array_of_CommandOutputRecordField
162
                .loadField(__doc.get("fields"), __baseUri, __loadingOptions);
1✔
163
      } catch (ValidationException e) {
×
164
        fields = null; // won't be used but prevents compiler from complaining.
×
165
        final String __message = "the `fields` field is not valid because:";
×
166
        __errors.add(new ValidationException(__message, e));
×
167
      }
1✔
168

169
    } else {
170
      fields = null;
1✔
171
    }
172
    Record_name type;
173
    try {
174
      type =
1✔
175
          LoaderInstances
176
              .typedsl_Record_name_2
177
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
178
    } catch (ValidationException e) {
1✔
179
      type = null; // won't be used but prevents compiler from complaining.
1✔
180
      final String __message = "the `type` field is not valid because:";
1✔
181
      __errors.add(new ValidationException(__message, e));
1✔
182
    }
1✔
183
    java.util.Optional<String> label;
184

185
    if (__doc.containsKey("label")) {
1✔
186
      try {
187
        label =
×
188
            LoaderInstances
189
                .optional_StringInstance
190
                .loadField(__doc.get("label"), __baseUri, __loadingOptions);
×
191
      } catch (ValidationException e) {
×
192
        label = null; // won't be used but prevents compiler from complaining.
×
193
        final String __message = "the `label` field is not valid because:";
×
194
        __errors.add(new ValidationException(__message, e));
×
195
      }
×
196

197
    } else {
198
      label = null;
1✔
199
    }
200
    Object doc;
201

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

214
    } else {
215
      doc = null;
1✔
216
    }
217
    if (!__errors.isEmpty()) {
1✔
218
      throw new ValidationException("Trying 'RecordField'", __errors);
1✔
219
    }
220
    this.fields = (java.util.Optional<java.util.List<Object>>) fields;
1✔
221
    this.type = (Record_name) type;
1✔
222
    this.label = (java.util.Optional<String>) label;
1✔
223
    this.doc = (Object) doc;
1✔
224
    this.name = (java.util.Optional<String>) name;
1✔
225
  }
1✔
226
}
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