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

common-workflow-language / cwljava / #388

30 Oct 2025 04:55PM UTC coverage: 58.693% (-0.8%) from 59.538%
#388

Pull #218

github

web-flow
Merge ab8576a5b into befd7e4b9
Pull Request #218: Populate the extensionFields; add public accessors for LoadingOptions

230 of 569 new or added lines in 67 files covered. (40.42%)

28 existing lines in 27 files now uncovered.

7535 of 12838 relevant lines covered (58.69%)

0.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/org/w3id/cwl/cwl1_2/EnumSchemaImpl.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/salad#EnumSchema</I><BR> <BLOCKQUOTE>
25
 Define an enumerated type.
26
  </BLOCKQUOTE>
27
 */
28
public class EnumSchemaImpl extends SaveableImpl implements EnumSchema {
29
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
×
30
  private java.util.Map<String, Object> extensionFields_ =
×
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> name;
40

41
  /**
42
   * Getter for property <I>https://w3id.org/cwl/salad#EnumSchema/name</I><BR>
43

44
   */
45

46
  public java.util.Optional<String> getName() {
47
    return this.name;
×
48
  }
49

50
  private java.util.List<String> symbols;
51

52
  /**
53
   * Getter for property <I>https://w3id.org/cwl/salad#symbols</I><BR>
54
   * <BLOCKQUOTE>
55
   * Defines the set of valid symbols.   * </BLOCKQUOTE>
56
   */
57

58
  public java.util.List<String> getSymbols() {
59
    return this.symbols;
×
60
  }
61

62
  private Enum_name type;
63

64
  /**
65
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
66
   * <BLOCKQUOTE>
67
   * Must be `enum`   * </BLOCKQUOTE>
68
   */
69

70
  public Enum_name getType() {
71
    return this.type;
×
72
  }
73

74
  /**
75
   * Used by {@link org.w3id.cwl.cwl1_2.utils.RootLoader} to construct instances of EnumSchemaImpl.
76
   *
77
   * @param __doc_            Document fragment to load this record object from (presumably a
78
                              {@link java.util.Map}).
79
   * @param __baseUri_        Base URI to generate child document IDs against.
80
   * @param __loadingOptions  Context for loading URIs and populating objects.
81
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
82
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
83
   *                             or validation of fields fails.
84
   */
85
  public EnumSchemaImpl(
86
      final Object __doc_,
87
      final String __baseUri_,
88
      LoadingOptions __loadingOptions,
89
      final String __docRoot_) {
90
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
×
91
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
92
    // generated names.
93
    String __baseUri = __baseUri_;
×
94
    String __docRoot = __docRoot_;
×
95
    if (!(__doc_ instanceof java.util.Map)) {
×
96
      throw new ValidationException("EnumSchemaImpl called on non-map");
×
97
    }
98
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
×
99
    final java.util.List<ValidationException> __errors =
×
100
        new java.util.ArrayList<ValidationException>();
101
    if (__loadingOptions != null) {
×
102
      this.loadingOptions_ = __loadingOptions;
×
103
    }
104
    java.util.Optional<String> name;
105

106
    if (__doc.containsKey("name")) {
×
107
      try {
108
        name =
×
109
            LoaderInstances
110
                .uri_optional_StringInstance_True_False_None_None
111
                .loadField(__doc.get("name"), __baseUri, __loadingOptions);
×
112
      } catch (ValidationException e) {
×
113
        name = null; // won't be used but prevents compiler from complaining.
×
114
        final String __message = "the `name` field is not valid because:";
×
115
        __errors.add(new ValidationException(__message, e));
×
116
      }
×
117

118
    } else {
119
      name = null;
×
120
    }
121

122
    Boolean __original_is_null = name == null;
×
123
    if (name == null) {
×
124
      if (__docRoot != null) {
×
125
        name = java.util.Optional.of(__docRoot);
×
126
      } else {
127
        name = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
×
128
      }
129
    }
130
    if (__original_is_null) {
×
131
        __baseUri = __baseUri_;
×
132
    } else {
133
        __baseUri = (String) name.orElse(null);
×
134
    }
135
    java.util.List<String> symbols;
136
    try {
137
      symbols =
×
138
          LoaderInstances
139
              .uri_array_of_StringInstance_True_False_None_None
140
              .loadField(__doc.get("symbols"), __baseUri, __loadingOptions);
×
141
    } catch (ValidationException e) {
×
142
      symbols = null; // won't be used but prevents compiler from complaining.
×
143
      final String __message = "the `symbols` field is not valid because:";
×
144
      __errors.add(new ValidationException(__message, e));
×
145
    }
×
146
    Enum_name type;
147
    try {
148
      type =
×
149
          LoaderInstances
150
              .typedsl_Enum_name_2
151
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
×
152
    } catch (ValidationException e) {
×
153
      type = null; // won't be used but prevents compiler from complaining.
×
154
      final String __message = "the `type` field is not valid because:";
×
155
      __errors.add(new ValidationException(__message, e));
×
156
    }
×
157
    if (!__errors.isEmpty()) {
×
158
      throw new ValidationException("Trying 'RecordField'", __errors);
×
159
    }
160
    this.name = (java.util.Optional<String>) name;
×
161
    this.symbols = (java.util.List<String>) symbols;
×
162
    this.type = (Enum_name) type;
×
NEW
163
    for (String field:__doc.keySet()) {
×
NEW
164
      if (!attrs.contains(field)) {
×
NEW
165
        if (field.contains(":")) {
×
NEW
166
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
167
          extensionFields_.put(expanded_field, __doc.get(field));
×
168
        }
169
      }
NEW
170
    }
×
UNCOV
171
  }
×
NEW
172
  private java.util.List<String> attrs = java.util.Arrays.asList("name", "symbols", "type");
×
173
}
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