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

common-workflow-language / cwljava / #336

29 Jan 2025 12:41PM UTC coverage: 60.005% (-2.2%) from 62.203%
#336

Pull #192

github

web-flow
Merge 40f1ed817 into e28b918d2
Pull Request #192: regenerate using latest schema & schema-salad-tool

441 of 968 new or added lines in 65 files covered. (45.56%)

21 existing lines in 3 files now uncovered.

7347 of 12244 relevant lines covered (60.0%)

0.6 hits per line

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

46.58
/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

31
  private java.util.Optional<String> name;
32

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

39
  public java.util.Optional<String> getName() {
40
    return this.name;
×
41
  }
42

43
  private java.util.List<String> symbols;
44

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

51
  public java.util.List<String> getSymbols() {
52
    return this.symbols;
×
53
  }
54

55
  private Enum_name type;
56

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

63
  public Enum_name getType() {
64
    return this.type;
×
65
  }
66

67
  private java.util.Optional<String> label;
68

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

75
  public java.util.Optional<String> getLabel() {
76
    return this.label;
×
77
  }
78

79
  private Object doc;
80

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

87
  public Object getDoc() {
88
    return this.doc;
×
89
  }
90

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

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

135
    } else {
136
      name = null;
1✔
137
    }
138

139
    Boolean __original_is_null = name == null;
1✔
140
    if (name == null) {
1✔
141
      if (__docRoot != null) {
1✔
142
        name = java.util.Optional.of(__docRoot);
×
143
      } else {
144
        name = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
1✔
145
      }
146
    }
147
    if (__original_is_null) {
1✔
148
        __baseUri = __baseUri_;
1✔
149
    } else {
150
        __baseUri = (String) name.orElse(null);
×
151
    }
152
    java.util.List<String> symbols;
153
    try {
154
      symbols =
1✔
155
          LoaderInstances
156
              .uri_array_of_StringInstance_True_False_None_None
157
              .loadField(__doc.get("symbols"), __baseUri, __loadingOptions);
×
158
    } catch (ValidationException e) {
1✔
159
      symbols = null; // won't be used but prevents compiler from complaining.
1✔
160
      final String __message = "the `symbols` field is not valid because:";
1✔
161
      __errors.add(new ValidationException(__message, e));
1✔
162
    }
×
163
    Enum_name type;
164
    try {
165
      type =
1✔
166
          LoaderInstances
167
              .typedsl_Enum_name_2
168
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
×
169
    } catch (ValidationException e) {
1✔
170
      type = null; // won't be used but prevents compiler from complaining.
1✔
171
      final String __message = "the `type` field is not valid because:";
1✔
172
      __errors.add(new ValidationException(__message, e));
1✔
173
    }
×
174
    java.util.Optional<String> label;
175

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

188
    } else {
189
      label = null;
1✔
190
    }
191
    Object doc;
192

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

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