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

common-workflow-language / cwljava / #339

29 Jan 2025 01:23PM UTC coverage: 59.538% (-0.6%) from 60.167%
#339

Pull #193

github

web-flow
Merge 94c260498 into 0978523bc
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

60.61
/src/main/java/org/w3id/cwl/cwl1_1/EnvironmentDefImpl.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#EnvironmentDef</I><BR> <BLOCKQUOTE>
25
 Define an environment variable that will be set in the runtime environment
26
 by the workflow platform when executing the command line tool.  May be the
27
 result of executing an expression, such as getting a parameter from input.
28
  </BLOCKQUOTE>
29
 */
30
public class EnvironmentDefImpl extends SaveableImpl implements EnvironmentDef {
31
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
32
  private java.util.Map<String, Object> extensionFields_ =
1✔
33
      new java.util.HashMap<String, Object>();
34
  public java.util.Map<String, Object> getExtensionFields() {
NEW
35
    return this.extensionFields_;
×
36
  }
37

38
  private String envName;
39

40
  /**
41
   * Getter for property <I>https://w3id.org/cwl/cwl#EnvironmentDef/envName</I><BR>
42
   * <BLOCKQUOTE>
43
   * The environment variable name   * </BLOCKQUOTE>
44
   */
45

46
  public String getEnvName() {
47
    return this.envName;
×
48
  }
49

50
  private Object envValue;
51

52
  /**
53
   * Getter for property <I>https://w3id.org/cwl/cwl#EnvironmentDef/envValue</I><BR>
54
   * <BLOCKQUOTE>
55
   * The environment variable value   * </BLOCKQUOTE>
56
   */
57

58
  public Object getEnvValue() {
59
    return this.envValue;
×
60
  }
61

62
  /**
63
   * Used by {@link org.w3id.cwl.cwl1_1.utils.RootLoader} to construct instances of EnvironmentDefImpl.
64
   *
65
   * @param __doc_            Document fragment to load this record object from (presumably a
66
                              {@link java.util.Map}).
67
   * @param __baseUri_        Base URI to generate child document IDs against.
68
   * @param __loadingOptions  Context for loading URIs and populating objects.
69
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
70
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
71
   *                             or validation of fields fails.
72
   */
73
  public EnvironmentDefImpl(
74
      final Object __doc_,
75
      final String __baseUri_,
76
      LoadingOptions __loadingOptions,
77
      final String __docRoot_) {
78
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
79
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
80
    // generated names.
81
    String __baseUri = __baseUri_;
1✔
82
    String __docRoot = __docRoot_;
1✔
83
    if (!(__doc_ instanceof java.util.Map)) {
1✔
84
      throw new ValidationException("EnvironmentDefImpl called on non-map");
×
85
    }
86
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
87
    final java.util.List<ValidationException> __errors =
1✔
88
        new java.util.ArrayList<ValidationException>();
89
    if (__loadingOptions != null) {
1✔
90
      this.loadingOptions_ = __loadingOptions;
1✔
91
    }
92
    String envName;
93
    try {
94
      envName =
1✔
95
          LoaderInstances
96
              .StringInstance
97
              .loadField(__doc.get("envName"), __baseUri, __loadingOptions);
1✔
98
    } catch (ValidationException e) {
×
99
      envName = null; // won't be used but prevents compiler from complaining.
×
100
      final String __message = "the `envName` field is not valid because:";
×
101
      __errors.add(new ValidationException(__message, e));
×
102
    }
1✔
103
    Object envValue;
104
    try {
105
      envValue =
1✔
106
          LoaderInstances
107
              .union_of_StringInstance_or_ExpressionLoader
108
              .loadField(__doc.get("envValue"), __baseUri, __loadingOptions);
1✔
109
    } catch (ValidationException e) {
×
110
      envValue = null; // won't be used but prevents compiler from complaining.
×
111
      final String __message = "the `envValue` field is not valid because:";
×
112
      __errors.add(new ValidationException(__message, e));
×
113
    }
1✔
114
    if (!__errors.isEmpty()) {
1✔
115
      throw new ValidationException("Trying 'RecordField'", __errors);
×
116
    }
117
    this.envName = (String) envName;
1✔
118
    this.envValue = (Object) envValue;
1✔
119
  }
1✔
120
}
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