• 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

45.54
/src/main/java/org/w3id/cwl/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.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#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 java.util.Map<String, Object> getExtensionFields() {
NEW
52
    return this.extensionFields_;
×
53
  }
54

55
  private ResourceRequirement_class class_;
56

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

63
  public ResourceRequirement_class getClass_() {
64
    return this.class_;
×
65
  }
66

67
  private Object coresMin;
68

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

75
  public Object getCoresMin() {
76
    return this.coresMin;
×
77
  }
78

79
  private Object coresMax;
80

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

87
  public Object getCoresMax() {
88
    return this.coresMax;
×
89
  }
90

91
  private Object ramMin;
92

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

99
  public Object getRamMin() {
100
    return this.ramMin;
×
101
  }
102

103
  private Object ramMax;
104

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

111
  public Object getRamMax() {
112
    return this.ramMax;
×
113
  }
114

115
  private Object tmpdirMin;
116

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

123
  public Object getTmpdirMin() {
124
    return this.tmpdirMin;
×
125
  }
126

127
  private Object tmpdirMax;
128

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

135
  public Object getTmpdirMax() {
136
    return this.tmpdirMax;
×
137
  }
138

139
  private Object outdirMin;
140

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

147
  public Object getOutdirMin() {
148
    return this.outdirMin;
×
149
  }
150

151
  private Object outdirMax;
152

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

159
  public Object getOutdirMax() {
160
    return this.outdirMax;
×
161
  }
162

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

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

218
    } else {
219
      coresMin = null;
1✔
220
    }
221
    Object coresMax;
222

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

235
    } else {
236
      coresMax = null;
1✔
237
    }
238
    Object ramMin;
239

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

252
    } else {
253
      ramMin = null;
1✔
254
    }
255
    Object ramMax;
256

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

269
    } else {
270
      ramMax = null;
1✔
271
    }
272
    Object tmpdirMin;
273

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

286
    } else {
287
      tmpdirMin = null;
1✔
288
    }
289
    Object tmpdirMax;
290

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

303
    } else {
304
      tmpdirMax = null;
1✔
305
    }
306
    Object outdirMin;
307

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

320
    } else {
321
      outdirMin = null;
1✔
322
    }
323
    Object outdirMax;
324

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

337
    } else {
338
      outdirMax = null;
1✔
339
    }
340
    if (!__errors.isEmpty()) {
1✔
341
      throw new ValidationException("Trying 'RecordField'", __errors);
1✔
342
    }
343
    this.class_ = (ResourceRequirement_class) class_;
1✔
344
    this.coresMin = (Object) coresMin;
1✔
345
    this.coresMax = (Object) coresMax;
1✔
346
    this.ramMin = (Object) ramMin;
1✔
347
    this.ramMax = (Object) ramMax;
1✔
348
    this.tmpdirMin = (Object) tmpdirMin;
1✔
349
    this.tmpdirMax = (Object) tmpdirMax;
1✔
350
    this.outdirMin = (Object) outdirMin;
1✔
351
    this.outdirMax = (Object) outdirMax;
1✔
352
  }
1✔
353
}
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