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

common-workflow-language / cwljava / #357

22 May 2025 02:21AM CUT coverage: 60.167%. Remained the same
#357

Pull #202

github

web-flow
Merge ebbbbb341 into 629fbd09e
Pull Request #202: Bump advanced-security/maven-dependency-submission-action from 4.1.3 to 5.0.0

7347 of 12211 relevant lines covered (60.17%)

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_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.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/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

33
  private java.util.Optional<String> name;
34

35
  /**
36
   * Getter for property <I>https://w3id.org/cwl/salad#EnumSchema/name</I><BR>
37

38
   */
39

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

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

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

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

56
  private Enum_name type;
57

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

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

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

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

112
    } else {
113
      name = null;
×
114
    }
115

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

© 2025 Coveralls, Inc