• 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

0.0
/src/main/java/org/commonwl/cwlsdk/cwl1_2/RecordSchemaImpl.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_1;
16

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

23
/**
24
* Auto-generated class implementation for <I>https://w3id.org/cwl/salad#RecordSchema</I><BR>
25
 */
26
public class RecordSchemaImpl extends SaveableImpl implements RecordSchema {
NEW
27
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
×
NEW
28
  private java.util.Map<String, Object> extensionFields_ =
×
29
      new java.util.HashMap<String, Object>();
30
  public LoadingOptions getLoadingOptions() {
NEW
31
    return this.loadingOptions_;
×
32
  }
33
  public java.util.Map<String, Object> getExtensionFields() {
NEW
34
    return this.extensionFields_;
×
35
  }
36

37
  private java.util.Optional<java.util.List<Object>> fields;
38

39
  /**
40
   * Getter for property <I>https://w3id.org/cwl/salad#fields</I><BR>
41
   * <BLOCKQUOTE>
42
   * Defines the fields of the record.   * </BLOCKQUOTE>
43
   */
44

45
  public java.util.Optional<java.util.List<Object>> getFields() {
NEW
46
    return this.fields;
×
47
  }
48

49
  private Record_name type;
50

51
  /**
52
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
53
   * <BLOCKQUOTE>
54
   * Must be `record`   * </BLOCKQUOTE>
55
   */
56

57
  public Record_name getType() {
NEW
58
    return this.type;
×
59
  }
60

61
  /**
62
   * Used by {@link org.commonwl.cwlsdk.cwl1_1.utils.RootLoader} to construct instances of RecordSchemaImpl.
63
   *
64
   * @param __doc_            Document fragment to load this record object from (presumably a
65
                              {@link java.util.Map}).
66
   * @param __baseUri_        Base URI to generate child document IDs against.
67
   * @param __loadingOptions  Context for loading URIs and populating objects.
68
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
69
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
70
   *                             or validation of fields fails.
71
   */
72
  public RecordSchemaImpl(
73
      final Object __doc_,
74
      final String __baseUri_,
75
      LoadingOptions __loadingOptions,
76
      final String __docRoot_) {
NEW
77
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
×
78
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
79
    // generated names.
NEW
80
    String __baseUri = __baseUri_;
×
NEW
81
    String __docRoot = __docRoot_;
×
NEW
82
    if (!(__doc_ instanceof java.util.Map)) {
×
NEW
83
      throw new ValidationException("RecordSchemaImpl called on non-map");
×
84
    }
NEW
85
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
×
NEW
86
    final java.util.List<ValidationException> __errors =
×
87
        new java.util.ArrayList<ValidationException>();
NEW
88
    if (__loadingOptions != null) {
×
NEW
89
      this.loadingOptions_ = __loadingOptions;
×
90
    }
91
    java.util.Optional<java.util.List<Object>> fields;
92

NEW
93
    if (__doc.containsKey("fields")) {
×
94
      try {
NEW
95
        fields =
×
96
            LoaderInstances
97
                .idmap_fields_optional_array_of_RecordField
NEW
98
                .loadField(__doc.get("fields"), __baseUri, __loadingOptions);
×
NEW
99
      } catch (ValidationException e) {
×
NEW
100
        fields = null; // won't be used but prevents compiler from complaining.
×
NEW
101
        final String __message = "the `fields` field is not valid because:";
×
NEW
102
        __errors.add(new ValidationException(__message, e));
×
NEW
103
      }
×
104

105
    } else {
NEW
106
      fields = null;
×
107
    }
108
    Record_name type;
109
    try {
NEW
110
      type =
×
111
          LoaderInstances
112
              .typedsl_Record_name_2
NEW
113
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
×
NEW
114
    } catch (ValidationException e) {
×
NEW
115
      type = null; // won't be used but prevents compiler from complaining.
×
NEW
116
      final String __message = "the `type` field is not valid because:";
×
NEW
117
      __errors.add(new ValidationException(__message, e));
×
NEW
118
    }
×
NEW
119
    if (!__errors.isEmpty()) {
×
NEW
120
      throw new ValidationException("Trying 'RecordField'", __errors);
×
121
    }
NEW
122
    this.fields = (java.util.Optional<java.util.List<Object>>) fields;
×
NEW
123
    this.type = (Record_name) type;
×
NEW
124
    for (String field:__doc.keySet()) {
×
NEW
125
      if (!attrs.contains(field)) {
×
NEW
126
        if (field.contains(":")) {
×
NEW
127
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
128
          extensionFields_.put(expanded_field, __doc.get(field));
×
129
        }
130
      }
NEW
131
    }
×
NEW
132
  }
×
NEW
133
  private java.util.List<String> attrs = java.util.Arrays.asList("fields", "type");
×
134
}
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