• 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

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 java.util.Map<String, Object> getExtensionFields() {
NEW
33
    return this.extensionFields_;
×
34
  }
35

36
  private java.util.Optional<String> name;
37

38
  /**
39
   * Getter for property <I>https://w3id.org/cwl/salad#EnumSchema/name</I><BR>
40

41
   */
42

43
  public java.util.Optional<String> getName() {
44
    return this.name;
×
45
  }
46

47
  private java.util.List<String> symbols;
48

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

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

59
  private Enum_name type;
60

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

67
  public Enum_name getType() {
68
    return this.type;
×
69
  }
70

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

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

115
    } else {
116
      name = null;
×
117
    }
118

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