• 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_1/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.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#EnumSchema</I><BR> <BLOCKQUOTE>
25
 Define an enumerated type.
26
  </BLOCKQUOTE>
27
 */
28
public class EnumSchemaImpl extends SaveableImpl implements EnumSchema {
NEW
29
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
×
NEW
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() {
NEW
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() {
NEW
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() {
NEW
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() {
NEW
71
    return this.type;
×
72
  }
73

74
  /**
75
   * Used by {@link org.commonwl.cwlsdk.cwl1_1.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_) {
NEW
90
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
×
91
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
92
    // generated names.
NEW
93
    String __baseUri = __baseUri_;
×
NEW
94
    String __docRoot = __docRoot_;
×
NEW
95
    if (!(__doc_ instanceof java.util.Map)) {
×
NEW
96
      throw new ValidationException("EnumSchemaImpl called on non-map");
×
97
    }
NEW
98
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
×
NEW
99
    final java.util.List<ValidationException> __errors =
×
100
        new java.util.ArrayList<ValidationException>();
NEW
101
    if (__loadingOptions != null) {
×
NEW
102
      this.loadingOptions_ = __loadingOptions;
×
103
    }
104
    java.util.Optional<String> name;
105

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

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

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