• 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

45.83
/src/main/java/org/commonwl/cwlsdk/cwl1_1/ResourceRequirementImpl.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/cwl#ResourceRequirement</I><BR> <BLOCKQUOTE>
25
 Specify basic hardware resource requirements.
26
 
27
 "min" is the minimum amount of a resource that must be reserved to schedule
28
 a job. If "min" cannot be satisfied, the job should not be run.
29
 
30
 "max" is the maximum amount of a resource that the job shall be permitted
31
 to use. If a node has sufficient resources, multiple jobs may be scheduled
32
 on a single node provided each job's "max" resource requirements are
33
 met. If a job attempts to exceed its "max" resource allocation, an
34
 implementation may deny additional resources, which may result in job
35
 failure.
36
 
37
 If "min" is specified but "max" is not, then "max" == "min"
38
 If "max" is specified by "min" is not, then "min" == "max".
39
 
40
 It is an error if max < min.
41
 
42
 It is an error if the value of any of these fields is negative.
43
 
44
 If neither "min" nor "max" is specified for a resource, use the default values below.
45
  </BLOCKQUOTE>
46
 */
47
public class ResourceRequirementImpl extends SaveableImpl implements ResourceRequirement {
48
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
49
  private java.util.Map<String, Object> extensionFields_ =
1✔
50
      new java.util.HashMap<String, Object>();
51
  public LoadingOptions getLoadingOptions() {
NEW
52
    return this.loadingOptions_;
×
53
  }
54
  public java.util.Map<String, Object> getExtensionFields() {
NEW
55
    return this.extensionFields_;
×
56
  }
57

58
  private ResourceRequirement_class class_;
59

60
  /**
61
   * Getter for property <I>https://w3id.org/cwl/cwl#ResourceRequirement/class</I><BR>
62
   * <BLOCKQUOTE>
63
   * Always 'ResourceRequirement'   * </BLOCKQUOTE>
64
   */
65

66
  public ResourceRequirement_class getClass_() {
NEW
67
    return this.class_;
×
68
  }
69

70
  private Object coresMin;
71

72
  /**
73
   * Getter for property <I>https://w3id.org/cwl/cwl#ResourceRequirement/coresMin</I><BR>
74
   * <BLOCKQUOTE>
75
   * Minimum reserved number of CPU cores (default is 1)   * </BLOCKQUOTE>
76
   */
77

78
  public Object getCoresMin() {
NEW
79
    return this.coresMin;
×
80
  }
81

82
  private Object coresMax;
83

84
  /**
85
   * Getter for property <I>https://w3id.org/cwl/cwl#ResourceRequirement/coresMax</I><BR>
86
   * <BLOCKQUOTE>
87
   * Maximum reserved number of CPU cores   * </BLOCKQUOTE>
88
   */
89

90
  public Object getCoresMax() {
NEW
91
    return this.coresMax;
×
92
  }
93

94
  private Object ramMin;
95

96
  /**
97
   * Getter for property <I>https://w3id.org/cwl/cwl#ResourceRequirement/ramMin</I><BR>
98
   * <BLOCKQUOTE>
99
   * Minimum reserved RAM in mebibytes (2**20) (default is 256)   * </BLOCKQUOTE>
100
   */
101

102
  public Object getRamMin() {
NEW
103
    return this.ramMin;
×
104
  }
105

106
  private Object ramMax;
107

108
  /**
109
   * Getter for property <I>https://w3id.org/cwl/cwl#ResourceRequirement/ramMax</I><BR>
110
   * <BLOCKQUOTE>
111
   * Maximum reserved RAM in mebibytes (2**20)   * </BLOCKQUOTE>
112
   */
113

114
  public Object getRamMax() {
NEW
115
    return this.ramMax;
×
116
  }
117

118
  private Object tmpdirMin;
119

120
  /**
121
   * Getter for property <I>https://w3id.org/cwl/cwl#ResourceRequirement/tmpdirMin</I><BR>
122
   * <BLOCKQUOTE>
123
   * Minimum reserved filesystem based storage for the designated temporary directory, in mebibytes (2**20) (default is 1024)   * </BLOCKQUOTE>
124
   */
125

126
  public Object getTmpdirMin() {
NEW
127
    return this.tmpdirMin;
×
128
  }
129

130
  private Object tmpdirMax;
131

132
  /**
133
   * Getter for property <I>https://w3id.org/cwl/cwl#ResourceRequirement/tmpdirMax</I><BR>
134
   * <BLOCKQUOTE>
135
   * Maximum reserved filesystem based storage for the designated temporary directory, in mebibytes (2**20)   * </BLOCKQUOTE>
136
   */
137

138
  public Object getTmpdirMax() {
NEW
139
    return this.tmpdirMax;
×
140
  }
141

142
  private Object outdirMin;
143

144
  /**
145
   * Getter for property <I>https://w3id.org/cwl/cwl#ResourceRequirement/outdirMin</I><BR>
146
   * <BLOCKQUOTE>
147
   * Minimum reserved filesystem based storage for the designated output directory, in mebibytes (2**20) (default is 1024)   * </BLOCKQUOTE>
148
   */
149

150
  public Object getOutdirMin() {
NEW
151
    return this.outdirMin;
×
152
  }
153

154
  private Object outdirMax;
155

156
  /**
157
   * Getter for property <I>https://w3id.org/cwl/cwl#ResourceRequirement/outdirMax</I><BR>
158
   * <BLOCKQUOTE>
159
   * Maximum reserved filesystem based storage for the designated output directory, in mebibytes (2**20)   * </BLOCKQUOTE>
160
   */
161

162
  public Object getOutdirMax() {
NEW
163
    return this.outdirMax;
×
164
  }
165

166
  /**
167
   * Used by {@link org.commonwl.cwlsdk.cwl1_1.utils.RootLoader} to construct instances of ResourceRequirementImpl.
168
   *
169
   * @param __doc_            Document fragment to load this record object from (presumably a
170
                              {@link java.util.Map}).
171
   * @param __baseUri_        Base URI to generate child document IDs against.
172
   * @param __loadingOptions  Context for loading URIs and populating objects.
173
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
174
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
175
   *                             or validation of fields fails.
176
   */
177
  public ResourceRequirementImpl(
178
      final Object __doc_,
179
      final String __baseUri_,
180
      LoadingOptions __loadingOptions,
181
      final String __docRoot_) {
182
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
183
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
184
    // generated names.
185
    String __baseUri = __baseUri_;
1✔
186
    String __docRoot = __docRoot_;
1✔
187
    if (!(__doc_ instanceof java.util.Map)) {
1✔
NEW
188
      throw new ValidationException("ResourceRequirementImpl called on non-map");
×
189
    }
190
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
191
    final java.util.List<ValidationException> __errors =
1✔
192
        new java.util.ArrayList<ValidationException>();
193
    if (__loadingOptions != null) {
1✔
194
      this.loadingOptions_ = __loadingOptions;
1✔
195
    }
196
    ResourceRequirement_class class_;
197
    try {
198
      class_ =
1✔
199
          LoaderInstances
200
              .uri_ResourceRequirement_class_False_True_None_None
201
              .loadField(__doc.get("class"), __baseUri, __loadingOptions);
1✔
202
    } catch (ValidationException e) {
1✔
203
      class_ = null; // won't be used but prevents compiler from complaining.
1✔
204
      final String __message = "the `class` field is not valid because:";
1✔
205
      __errors.add(new ValidationException(__message, e));
1✔
206
    }
1✔
207
    Object coresMin;
208

209
    if (__doc.containsKey("coresMin")) {
1✔
210
      try {
211
        coresMin =
1✔
212
            LoaderInstances
213
                .union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_ExpressionLoader
214
                .loadField(__doc.get("coresMin"), __baseUri, __loadingOptions);
1✔
NEW
215
      } catch (ValidationException e) {
×
NEW
216
        coresMin = null; // won't be used but prevents compiler from complaining.
×
NEW
217
        final String __message = "the `coresMin` field is not valid because:";
×
NEW
218
        __errors.add(new ValidationException(__message, e));
×
219
      }
1✔
220

221
    } else {
222
      coresMin = null;
1✔
223
    }
224
    Object coresMax;
225

226
    if (__doc.containsKey("coresMax")) {
1✔
227
      try {
228
        coresMax =
1✔
229
            LoaderInstances
230
                .union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_ExpressionLoader
231
                .loadField(__doc.get("coresMax"), __baseUri, __loadingOptions);
1✔
NEW
232
      } catch (ValidationException e) {
×
NEW
233
        coresMax = null; // won't be used but prevents compiler from complaining.
×
NEW
234
        final String __message = "the `coresMax` field is not valid because:";
×
NEW
235
        __errors.add(new ValidationException(__message, e));
×
236
      }
1✔
237

238
    } else {
239
      coresMax = null;
1✔
240
    }
241
    Object ramMin;
242

243
    if (__doc.containsKey("ramMin")) {
1✔
244
      try {
NEW
245
        ramMin =
×
246
            LoaderInstances
247
                .union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_ExpressionLoader
NEW
248
                .loadField(__doc.get("ramMin"), __baseUri, __loadingOptions);
×
NEW
249
      } catch (ValidationException e) {
×
NEW
250
        ramMin = null; // won't be used but prevents compiler from complaining.
×
NEW
251
        final String __message = "the `ramMin` field is not valid because:";
×
NEW
252
        __errors.add(new ValidationException(__message, e));
×
NEW
253
      }
×
254

255
    } else {
256
      ramMin = null;
1✔
257
    }
258
    Object ramMax;
259

260
    if (__doc.containsKey("ramMax")) {
1✔
261
      try {
NEW
262
        ramMax =
×
263
            LoaderInstances
264
                .union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_ExpressionLoader
NEW
265
                .loadField(__doc.get("ramMax"), __baseUri, __loadingOptions);
×
NEW
266
      } catch (ValidationException e) {
×
NEW
267
        ramMax = null; // won't be used but prevents compiler from complaining.
×
NEW
268
        final String __message = "the `ramMax` field is not valid because:";
×
NEW
269
        __errors.add(new ValidationException(__message, e));
×
NEW
270
      }
×
271

272
    } else {
273
      ramMax = null;
1✔
274
    }
275
    Object tmpdirMin;
276

277
    if (__doc.containsKey("tmpdirMin")) {
1✔
278
      try {
NEW
279
        tmpdirMin =
×
280
            LoaderInstances
281
                .union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_ExpressionLoader
NEW
282
                .loadField(__doc.get("tmpdirMin"), __baseUri, __loadingOptions);
×
NEW
283
      } catch (ValidationException e) {
×
NEW
284
        tmpdirMin = null; // won't be used but prevents compiler from complaining.
×
NEW
285
        final String __message = "the `tmpdirMin` field is not valid because:";
×
NEW
286
        __errors.add(new ValidationException(__message, e));
×
NEW
287
      }
×
288

289
    } else {
290
      tmpdirMin = null;
1✔
291
    }
292
    Object tmpdirMax;
293

294
    if (__doc.containsKey("tmpdirMax")) {
1✔
295
      try {
NEW
296
        tmpdirMax =
×
297
            LoaderInstances
298
                .union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_ExpressionLoader
NEW
299
                .loadField(__doc.get("tmpdirMax"), __baseUri, __loadingOptions);
×
NEW
300
      } catch (ValidationException e) {
×
NEW
301
        tmpdirMax = null; // won't be used but prevents compiler from complaining.
×
NEW
302
        final String __message = "the `tmpdirMax` field is not valid because:";
×
NEW
303
        __errors.add(new ValidationException(__message, e));
×
NEW
304
      }
×
305

306
    } else {
307
      tmpdirMax = null;
1✔
308
    }
309
    Object outdirMin;
310

311
    if (__doc.containsKey("outdirMin")) {
1✔
312
      try {
NEW
313
        outdirMin =
×
314
            LoaderInstances
315
                .union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_ExpressionLoader
NEW
316
                .loadField(__doc.get("outdirMin"), __baseUri, __loadingOptions);
×
NEW
317
      } catch (ValidationException e) {
×
NEW
318
        outdirMin = null; // won't be used but prevents compiler from complaining.
×
NEW
319
        final String __message = "the `outdirMin` field is not valid because:";
×
NEW
320
        __errors.add(new ValidationException(__message, e));
×
NEW
321
      }
×
322

323
    } else {
324
      outdirMin = null;
1✔
325
    }
326
    Object outdirMax;
327

328
    if (__doc.containsKey("outdirMax")) {
1✔
329
      try {
NEW
330
        outdirMax =
×
331
            LoaderInstances
332
                .union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_ExpressionLoader
NEW
333
                .loadField(__doc.get("outdirMax"), __baseUri, __loadingOptions);
×
NEW
334
      } catch (ValidationException e) {
×
NEW
335
        outdirMax = null; // won't be used but prevents compiler from complaining.
×
NEW
336
        final String __message = "the `outdirMax` field is not valid because:";
×
NEW
337
        __errors.add(new ValidationException(__message, e));
×
NEW
338
      }
×
339

340
    } else {
341
      outdirMax = null;
1✔
342
    }
343
    if (!__errors.isEmpty()) {
1✔
344
      throw new ValidationException("Trying 'RecordField'", __errors);
1✔
345
    }
346
    this.class_ = (ResourceRequirement_class) class_;
1✔
347
    this.coresMin = (Object) coresMin;
1✔
348
    this.coresMax = (Object) coresMax;
1✔
349
    this.ramMin = (Object) ramMin;
1✔
350
    this.ramMax = (Object) ramMax;
1✔
351
    this.tmpdirMin = (Object) tmpdirMin;
1✔
352
    this.tmpdirMax = (Object) tmpdirMax;
1✔
353
    this.outdirMin = (Object) outdirMin;
1✔
354
    this.outdirMax = (Object) outdirMax;
1✔
355
    for (String field:__doc.keySet()) {
1✔
356
      if (!attrs.contains(field)) {
1✔
NEW
357
        if (field.contains(":")) {
×
NEW
358
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
359
          extensionFields_.put(expanded_field, __doc.get(field));
×
360
        }
361
      }
362
    }
1✔
363
  }
1✔
364
  private java.util.List<String> attrs = java.util.Arrays.asList("class", "coresMin", "coresMax", "ramMin", "ramMax", "tmpdirMin", "tmpdirMax", "outdirMin", "outdirMax");
1✔
365
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc