• 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

0.0
/src/main/java/org/w3id/cwl/cwl1_1/SoftwarePackageImpl.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#SoftwarePackage</I><BR>
25
 */
26
public class SoftwarePackageImpl extends SaveableImpl implements SoftwarePackage {
27
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
×
28
  private java.util.Map<String, Object> extensionFields_ =
×
29
      new java.util.HashMap<String, Object>();
30
  public java.util.Map<String, Object> getExtensionFields() {
NEW
31
    return this.extensionFields_;
×
32
  }
33

34
  private String package_;
35

36
  /**
37
   * Getter for property <I>https://w3id.org/cwl/cwl#SoftwarePackage/package</I><BR>
38
   * <BLOCKQUOTE>
39
   * The name of the software to be made available. If the name is
40
   * common, inconsistent, or otherwise ambiguous it should be combined with
41
   * one or more identifiers in the `specs` field.
42
   *    * </BLOCKQUOTE>
43
   */
44

45
  public String getPackage() {
46
    return this.package_;
×
47
  }
48

49
  private java.util.Optional<java.util.List<String>> version;
50

51
  /**
52
   * Getter for property <I>https://w3id.org/cwl/cwl#SoftwarePackage/version</I><BR>
53
   * <BLOCKQUOTE>
54
   * The (optional) versions of the software that are known to be
55
   * compatible.
56
   *    * </BLOCKQUOTE>
57
   */
58

59
  public java.util.Optional<java.util.List<String>> getVersion() {
60
    return this.version;
×
61
  }
62

63
  private java.util.Optional<java.util.List<String>> specs;
64

65
  /**
66
   * Getter for property <I>https://w3id.org/cwl/cwl#SoftwarePackage/specs</I><BR>
67
   * <BLOCKQUOTE>
68
   * One or more [IRI](https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier)s
69
   * identifying resources for installing or enabling the software named in
70
   * the `package` field. Implementations may provide resolvers which map
71
   * these software identifer IRIs to some configuration action; or they can
72
   * use only the name from the `package` field on a best effort basis.
73
   * 
74
   * For example, the IRI https://packages.debian.org/bowtie could
75
   * be resolved with `apt-get install bowtie`. The IRI
76
   * https://anaconda.org/bioconda/bowtie could be resolved with `conda
77
   * install -c bioconda bowtie`.
78
   * 
79
   * IRIs can also be system independent and used to map to a specific
80
   * software installation or selection mechanism.
81
   * Using [RRID](https://www.identifiers.org/rrid/) as an example:
82
   * https://identifiers.org/rrid/RRID:SCR_005476
83
   * could be fulfilled using the above mentioned Debian or bioconda
84
   * package, a local installation managed by [Environement Modules](http://modules.sourceforge.net/),
85
   * or any other mechanism the platform chooses. IRIs can also be from
86
   * identifer sources that are discipline specific yet still system
87
   * independent. As an example, the equivalent [ELIXIR Tools and Data
88
   * Service Registry](https://bio.tools) IRI to the previous RRID example is
89
   * https://bio.tools/tool/bowtie2/version/2.2.8.
90
   * If supported by a given registry, implementations are encouraged to
91
   * query these system independent sofware identifier IRIs directly for
92
   * links to packaging systems.
93
   * 
94
   * A site specific IRI can be listed as well. For example, an academic
95
   * computing cluster using Environement Modules could list the IRI
96
   * `https://hpc.example.edu/modules/bowtie-tbb/1.22` to indicate that
97
   * `module load bowtie-tbb/1.1.2` should be executed to make available
98
   * `bowtie` version 1.1.2 compiled with the TBB library prior to running
99
   * the accompanying Workflow or CommandLineTool. Note that the example IRI
100
   * is specific to a particular institution and computing environment as
101
   * the Environment Modules system does not have a common namespace or
102
   * standardized naming convention.
103
   * 
104
   * This last example is the least portable and should only be used if
105
   * mechanisms based off of the `package` field or more generic IRIs are
106
   * unavailable or unsuitable. While harmless to other sites, site specific
107
   * software IRIs should be left out of shared CWL descriptions to avoid
108
   * clutter.
109
   *    * </BLOCKQUOTE>
110
   */
111

112
  public java.util.Optional<java.util.List<String>> getSpecs() {
113
    return this.specs;
×
114
  }
115

116
  /**
117
   * Used by {@link org.w3id.cwl.cwl1_1.utils.RootLoader} to construct instances of SoftwarePackageImpl.
118
   *
119
   * @param __doc_            Document fragment to load this record object from (presumably a
120
                              {@link java.util.Map}).
121
   * @param __baseUri_        Base URI to generate child document IDs against.
122
   * @param __loadingOptions  Context for loading URIs and populating objects.
123
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
124
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
125
   *                             or validation of fields fails.
126
   */
127
  public SoftwarePackageImpl(
128
      final Object __doc_,
129
      final String __baseUri_,
130
      LoadingOptions __loadingOptions,
131
      final String __docRoot_) {
132
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
×
133
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
134
    // generated names.
135
    String __baseUri = __baseUri_;
×
136
    String __docRoot = __docRoot_;
×
137
    if (!(__doc_ instanceof java.util.Map)) {
×
138
      throw new ValidationException("SoftwarePackageImpl called on non-map");
×
139
    }
140
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
×
141
    final java.util.List<ValidationException> __errors =
×
142
        new java.util.ArrayList<ValidationException>();
143
    if (__loadingOptions != null) {
×
144
      this.loadingOptions_ = __loadingOptions;
×
145
    }
146
    String package_;
147
    try {
148
      package_ =
×
149
          LoaderInstances
150
              .StringInstance
151
              .loadField(__doc.get("package"), __baseUri, __loadingOptions);
×
152
    } catch (ValidationException e) {
×
153
      package_ = null; // won't be used but prevents compiler from complaining.
×
154
      final String __message = "the `package` field is not valid because:";
×
155
      __errors.add(new ValidationException(__message, e));
×
156
    }
×
157
    java.util.Optional<java.util.List<String>> version;
158

159
    if (__doc.containsKey("version")) {
×
160
      try {
161
        version =
×
162
            LoaderInstances
163
                .optional_array_of_StringInstance
164
                .loadField(__doc.get("version"), __baseUri, __loadingOptions);
×
165
      } catch (ValidationException e) {
×
166
        version = null; // won't be used but prevents compiler from complaining.
×
167
        final String __message = "the `version` field is not valid because:";
×
168
        __errors.add(new ValidationException(__message, e));
×
169
      }
×
170

171
    } else {
172
      version = null;
×
173
    }
174
    java.util.Optional<java.util.List<String>> specs;
175

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

188
    } else {
189
      specs = null;
×
190
    }
191
    if (!__errors.isEmpty()) {
×
192
      throw new ValidationException("Trying 'RecordField'", __errors);
×
193
    }
194
    this.package_ = (String) package_;
×
195
    this.version = (java.util.Optional<java.util.List<String>>) version;
×
196
    this.specs = (java.util.Optional<java.util.List<String>>) specs;
×
197
  }
×
198
}
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