• 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

45.95
/src/main/java/org/w3id/cwl/cwl1_1/InputEnumSchemaImpl.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#InputEnumSchema</I><BR>
25
 */
26
public class InputEnumSchemaImpl extends SaveableImpl implements InputEnumSchema {
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.List<String> symbols;
47

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

54
  public java.util.List<String> getSymbols() {
55
    return this.symbols;
×
56
  }
57

58
  private Enum_name type;
59

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

66
  public Enum_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 InputEnumSchemaImpl.
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 InputEnumSchemaImpl(
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("InputEnumSchemaImpl 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 =
×
129
            LoaderInstances
130
                .uri_optional_StringInstance_True_False_None_None
131
                .loadField(__doc.get("name"), __baseUri, __loadingOptions);
×
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
      }
×
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);
×
154
    }
155
    java.util.List<String> symbols;
156
    try {
157
      symbols =
1✔
158
          LoaderInstances
159
              .uri_array_of_StringInstance_True_False_None_None
160
              .loadField(__doc.get("symbols"), __baseUri, __loadingOptions);
×
161
    } catch (ValidationException e) {
1✔
162
      symbols = null; // won't be used but prevents compiler from complaining.
1✔
163
      final String __message = "the `symbols` field is not valid because:";
1✔
164
      __errors.add(new ValidationException(__message, e));
1✔
165
    }
×
166
    Enum_name type;
167
    try {
168
      type =
1✔
169
          LoaderInstances
170
              .typedsl_Enum_name_2
171
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
×
172
    } catch (ValidationException e) {
1✔
173
      type = null; // won't be used but prevents compiler from complaining.
1✔
174
      final String __message = "the `type` field is not valid because:";
1✔
175
      __errors.add(new ValidationException(__message, e));
1✔
176
    }
×
177
    java.util.Optional<String> label;
178

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

191
    } else {
192
      label = null;
1✔
193
    }
194
    Object doc;
195

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

208
    } else {
209
      doc = null;
1✔
210
    }
211
    if (!__errors.isEmpty()) {
1✔
212
      throw new ValidationException("Trying 'RecordField'", __errors);
1✔
213
    }
214
    this.name = (java.util.Optional<String>) name;
×
215
    this.symbols = (java.util.List<String>) symbols;
×
216
    this.type = (Enum_name) type;
×
217
    this.label = (java.util.Optional<String>) label;
×
218
    this.doc = (Object) doc;
×
219
  }
×
220
}
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