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

pkiraly / metadata-qa-api / #742

14 Jan 2026 12:45PM UTC coverage: 85.581% (-0.6%) from 86.157%
#742

push

pkiraly
Add parent check

32 of 96 new or added lines in 7 files covered. (33.33%)

2 existing lines in 2 files now uncovered.

5686 of 6644 relevant lines covered (85.58%)

0.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

70.59
/src/main/java/de/gwdg/metadataqa/api/configuration/schema/Rule.java
1
package de.gwdg.metadataqa.api.configuration.schema;
2

3
import com.fasterxml.jackson.annotation.JsonGetter;
4
import com.fasterxml.jackson.annotation.JsonIgnore;
5
import com.fasterxml.jackson.annotation.JsonInclude;
6

7
import java.io.Serializable;
8
import java.lang.reflect.Field;
9
import java.util.ArrayList;
10
import java.util.List;
11

12
@JsonInclude(JsonInclude.Include.NON_NULL)
13
public class Rule implements Serializable {
1✔
14

15
  private static final long serialVersionUID = 4101184421853217836L;
16

17
  // general parameters
18
  private String id;
19
  private String description;
20
  private Integer failureScore;
21
  private Integer successScore;
22
  private Integer naScore;
23
  private Boolean hidden = Boolean.FALSE;
1✔
24
  private Boolean skip = Boolean.FALSE;
1✔
25
  private Boolean debug = Boolean.FALSE;
1✔
26
  private ApplicationScope scope;
27
  private Boolean mandatory = Boolean.FALSE;
1✔
28

29
  // checkers
30
  private String pattern;
31
  private String equals;
32
  private String disjoint;
33
  private List<String> in;
34
  private List<Rule> and;
35
  private List<Rule> or;
36
  private List<Rule> not;
37
  private Integer minCount;
38
  private Integer maxCount;
39
  private Double minExclusive;
40
  private Double minInclusive;
41
  private Double maxExclusive;
42
  private Double maxInclusive;
43
  private Integer minLength;
44
  private Integer maxLength;
45
  private String lessThan;
46
  private String lessThanOrEquals;
47
  private String hasValue;
48
  private Boolean unique;
49
  private List<String> contentType;
50
  private Integer maxWords;
51
  private Integer minWords;
52
  private Dimension dimension;
53
  private List<String> dependencies;
54
  private Boolean allowEmptyInstances = Boolean.FALSE;
1✔
55
  private Boolean multilingual;
56
  private ApplicationScope hasLanguageTag;
57
  private List<String> hasChildren;
58
  private MQAFPattern mqafPattern;
59
  private Boolean alwaysCheckDependencies = Boolean.FALSE;
1✔
60
  private String valuePath;
61
  private Integer timeout;
62
  private Boolean validLink;
63
  private String skippableUrl;
64
  private Boolean priorityOnFail;
65
  private Boolean parentCheck;
66
  private Boolean naIfNoParent;
67

68
  public String getId() {
69
    return id;
1✔
70
  }
71

72
  public void setId(String id) {
73
    this.id = id;
1✔
74
  }
1✔
75

76
  public Rule withId(String id) {
77
    this.id = id;
1✔
78
    return this;
1✔
79
  }
80

81
  public String getDescription() {
82
    return description;
1✔
83
  }
84

85
  public void setDescription(String description) {
86
    this.description = description;
1✔
87
  }
1✔
88

89
  public Rule withDescription(String description) {
90
    this.description = description;
×
91
    return this;
×
92
  }
93

94
  public String getPattern() {
95
    return pattern;
1✔
96
  }
97

98
  public void setPattern(String pattern) {
99
    this.pattern = pattern;
1✔
100
  }
1✔
101

102
  public Rule withPattern(String pattern) {
103
    setPattern(pattern);
1✔
104
    return this;
1✔
105
  }
106

107
  public String getEquals() {
108
    return equals;
1✔
109
  }
110

111
  public void setEquals(String equals) {
112
    this.equals = equals;
1✔
113
  }
1✔
114

115
  public Rule withEquals(String equals) {
116
    setEquals(equals);
1✔
117
    return this;
1✔
118
  }
119

120
  public String getDisjoint() {
121
    return disjoint;
1✔
122
  }
123

124
  public void setDisjoint(String disjoint) {
125
    this.disjoint = disjoint;
1✔
126
  }
1✔
127

128
  public Rule withDisjoint(String disjoint) {
129
    setDisjoint(disjoint);
1✔
130
    return this;
1✔
131
  }
132

133
  public List<String> getIn() {
134
    return in;
1✔
135
  }
136

137
  public void setIn(List<String> in) {
138
    this.in = in;
1✔
139
  }
1✔
140

141
  public Rule withIn(List<String> in) {
142
    setIn(in);
1✔
143
    return this;
1✔
144
  }
145

146
  @JsonGetter("and")
147
  public List<Rule> getAnd() {
148
    return and;
1✔
149
  }
150

151
  public void setAnd(List<Rule> and) {
152
    this.and = and;
1✔
153
  }
1✔
154

155
  public Rule withAnd(List<Rule> and) {
156
    setAnd(and);
1✔
157
    return this;
1✔
158
  }
159

160
  public List<Rule> getOr() {
161
    return or;
1✔
162
  }
163

164
  public void setOr(List<Rule> or) {
165
    this.or = or;
1✔
166
  }
1✔
167

168
  public Rule withOr(List<Rule> or) {
169
    setOr(or);
1✔
170
    return this;
1✔
171
  }
172

173
  public List<Rule> getNot() {
174
    return not;
1✔
175
  }
176

177
  public void setNot(List<Rule> not) {
178
    this.not = not;
1✔
179
  }
1✔
180

181
  public Rule withNot(List<Rule> not) {
182
    setNot(not);
×
183
    return this;
×
184
  }
185

186
  public Integer getMinCount() {
187
    return minCount;
1✔
188
  }
189

190
  public void setMinCount(Integer minCount) {
191
    this.minCount = minCount;
1✔
192
  }
1✔
193

194
  public void setMinCount(int minCount) {
195
    this.minCount = minCount;
1✔
196
  }
1✔
197

198
  public Rule withMinCount(int minCount) {
199
    setMinCount(minCount);
1✔
200
    return this;
1✔
201
  }
202

203
  public Integer getMaxCount() {
204
    return maxCount;
1✔
205
  }
206

207
  public void setMaxCount(Integer maxCount) {
208
    this.maxCount = maxCount;
1✔
209
  }
1✔
210

211
  public void setMaxCount(int maxCount) {
212
    this.maxCount = maxCount;
1✔
213
  }
1✔
214

215
  public Rule withMaxCount(int maxCount) {
216
    setMaxCount(maxCount);
1✔
217
    return this;
1✔
218
  }
219

220
  public Double getMinExclusive() {
221
    return minExclusive;
1✔
222
  }
223

224
  public void setMinExclusive(Double minExclusive) {
225
    this.minExclusive = minExclusive;
1✔
226
  }
1✔
227

228
  public Rule withMinExclusive(Double minExclusive) {
229
    setMinExclusive(minExclusive);
1✔
230
    return this;
1✔
231
  }
232

233
  public Rule withMinExclusive(Integer minExclusive) {
234
    setMinExclusive(Double.valueOf(minExclusive));
×
235
    return this;
×
236
  }
237

238
  public Double getMinInclusive() {
239
    return minInclusive;
1✔
240
  }
241

242
  public void setMinInclusive(Double minInclusive) {
243
    this.minInclusive = minInclusive;
1✔
244
  }
1✔
245

246
  public Rule withMinInclusive(Double minInclusive) {
247
    setMinInclusive(minInclusive);
1✔
248
    return this;
1✔
249
  }
250

251
  public Rule withMinInclusive(Integer minInclusive) {
252
    setMinInclusive(Double.valueOf(minInclusive));
×
253
    return this;
×
254
  }
255

256
  public Double getMaxExclusive() {
257
    return maxExclusive;
1✔
258
  }
259

260
  public void setMaxExclusive(Double maxExclusive) {
261
    this.maxExclusive = maxExclusive;
1✔
262
  }
1✔
263

264
  public Rule withMaxExclusive(Double maxExclusive) {
265
    setMaxExclusive(maxExclusive);
1✔
266
    return this;
1✔
267
  }
268

269
  public Rule withMaxExclusive(Integer maxExclusive) {
270
    setMaxExclusive(Double.valueOf(maxExclusive));
×
271
    return this;
×
272
  }
273

274
  public Double getMaxInclusive() {
275
    return maxInclusive;
1✔
276
  }
277

278
  public void setMaxInclusive(Double maxInclusive) {
279
    this.maxInclusive = maxInclusive;
1✔
280
  }
1✔
281

282
  public Rule withMaxInclusive(Double maxInclusive) {
283
    setMaxInclusive(maxInclusive);
1✔
284
    return this;
1✔
285
  }
286

287
  public Rule withMaxInclusive(Integer maxInclusive) {
288
    setMaxInclusive(Double.valueOf(maxInclusive));
×
289
    return this;
×
290
  }
291

292
  public Integer getMinLength() {
293
    return minLength;
1✔
294
  }
295

296
  public void setMinLength(Integer minLength) {
297
    this.minLength = minLength;
1✔
298
  }
1✔
299

300
  public void setMinLength(int minLength) {
301
    this.minLength = minLength;
1✔
302
  }
1✔
303

304
  public Rule withMinLength(int minLength) {
305
    setMinLength(minLength);
1✔
306
    return this;
1✔
307
  }
308

309
  public Integer getMaxLength() {
310
    return maxLength;
1✔
311
  }
312

313
  public void setMaxLength(Integer maxLength) {
314
    this.maxLength = maxLength;
1✔
315
  }
1✔
316

317
  public void setMaxLength(int maxLength) {
318
    this.maxLength = maxLength;
1✔
319
  }
1✔
320

321
  public Rule withMaxLength(int maxLength) {
322
    setMaxLength(maxLength);
1✔
323
    return this;
1✔
324
  }
325

326
  public String getLessThan() {
327
    return lessThan;
1✔
328
  }
329

330
  public void setLessThan(String lessThan) {
331
    this.lessThan = lessThan;
1✔
332
  }
1✔
333

334
  public Rule withLessThan(String lessThan) {
335
    setLessThan(lessThan);
1✔
336
    return this;
1✔
337
  }
338

339
  public String getLessThanOrEquals() {
340
    return lessThanOrEquals;
1✔
341
  }
342

343
  public void setLessThanOrEquals(String lessThanOrEquals) {
344
    this.lessThanOrEquals = lessThanOrEquals;
1✔
345
  }
1✔
346

347
  public Rule withLessThanOrEquals(String lessThanOrEquals) {
348
    setLessThanOrEquals(lessThanOrEquals);
1✔
349
    return this;
1✔
350
  }
351

352
  public String getHasValue() {
353
    return hasValue;
1✔
354
  }
355

356
  public void setHasValue(String hasValue) {
357
    this.hasValue = hasValue;
1✔
358
  }
1✔
359

360
  public Rule withHasValue(String hasValue) {
361
    setHasValue(hasValue);
1✔
362
    return this;
1✔
363
  }
364

365
  public List<String> getHasChildren() {
366
    return hasChildren;
1✔
367
  }
368

369
  public void setHasChildren(List<String> hasChildren) {
370
    this.hasChildren = hasChildren;
1✔
371
  }
1✔
372

373
  public Rule withHasChildren(List<String> hasChildren) {
374
    setHasChildren(hasChildren);
×
375
    return this;
×
376
  }
377

378
  public Integer getFailureScore() {
379
    return failureScore;
1✔
380
  }
381

382
  public void setFailureScore(Integer failureScore) {
383
    this.failureScore = failureScore;
1✔
384
  }
1✔
385

386
  public Rule withFailureScore(Integer failureScore) {
387
    setFailureScore(failureScore);
1✔
388
    return this;
1✔
389
  }
390

391
  public Integer getSuccessScore() {
392
    return successScore;
1✔
393
  }
394

395
  public void setSuccessScore(Integer successScore) {
396
    this.successScore = successScore;
1✔
397
  }
1✔
398

399
  public Rule withSuccessScore(Integer successScore) {
400
    setSuccessScore(successScore);
1✔
401
    return this;
1✔
402
  }
403

404
  public Integer getNaScore() {
405
    return naScore;
1✔
406
  }
407

408
  public void setNaScore(Integer naScore) {
409
    this.naScore = naScore;
1✔
410
  }
1✔
411

412
  public Rule withNaScore(Integer naScore) {
413
    setNaScore(naScore);
1✔
414
    return this;
1✔
415
  }
416

417
  public ApplicationScope getScope() {
418
    return scope;
1✔
419
  }
420

421
  public void setScope(ApplicationScope scope) {
422
    this.scope = scope;
1✔
423
  }
1✔
424

425
  public Rule withScope(ApplicationScope scope) {
426
    this.scope = scope;
×
427
    return this;
×
428
  }
429

430
  public Boolean getMandatory() {
431
    return mandatory;
1✔
432
  }
433

434
  public void setMandatory(Boolean mandatory) {
435
    this.mandatory = mandatory;
1✔
436
  }
1✔
437

438
  public Rule withMandatory(Boolean mandatory) {
439
    this.mandatory = mandatory;
×
440
    return this;
×
441
  }
442

443
  public Boolean getUnique() {
444
    return unique;
1✔
445
  }
446

447
  public void setUnique(Boolean unique) {
448
    this.unique = unique;
1✔
449
  }
1✔
450

451
  public Rule withUnique(Boolean unique) {
452
    setUnique(unique);
1✔
453
    return this;
1✔
454
  }
455

456
  public List<String> getContentType() {
457
    return contentType;
1✔
458
  }
459

460
  public void setContentType(List<String> contentType) {
461
    this.contentType = contentType;
1✔
462
  }
1✔
463

464
  public Rule withContentType(List<String> contentType) {
465
    this.contentType = contentType;
×
466
    return this;
×
467
  }
468

469
  public Integer getMaxWords() {
470
    return maxWords;
1✔
471
  }
472

473
  public void setMaxWords(Integer maxWords) {
474
    this.maxWords = maxWords;
1✔
475
  }
1✔
476

477
  public void setMaxWords(int maxWords) {
478
    this.maxWords = maxWords;
×
479
  }
×
480

481
  public Rule withMaxWords(int maxWords) {
482
    setMaxWords(maxWords);
×
483
    return this;
×
484
  }
485

486
  public Integer getMinWords() {
487
    return minWords;
1✔
488
  }
489

490
  public void setMinWords(Integer minWords) {
491
    this.minWords = minWords;
×
492
  }
×
493

494
  public void setMinWords(int minWords) {
495
    this.minWords = minWords;
×
496
  }
×
497

498
  public Rule withMinWords(int minWords) {
499
    setMaxWords(minWords);
×
500
    return this;
×
501
  }
502

503
  public Dimension getDimension() {
504
    return dimension;
1✔
505
  }
506

507
  public void setDimension(Dimension dimension) {
508
    this.dimension = dimension;
1✔
509
  }
1✔
510

511
  public Rule withDimension(Dimension dimension) {
512
    this.dimension = dimension;
×
513
    return this;
×
514
  }
515

516
  public Boolean getHidden() {
517
    return hidden;
1✔
518
  }
519

520
  public void setHidden(Boolean hidden) {
521
    this.hidden = hidden;
1✔
522
  }
1✔
523

524
  public Rule withHidden(Boolean hidden) {
525
    this.hidden = hidden;
×
526
    return this;
×
527
  }
528

529
  public List<String> getDependencies() {
530
    return dependencies;
1✔
531
  }
532

533
  public void setDependencies(List<String> dependencies) {
534
    this.dependencies = dependencies;
1✔
535
  }
1✔
536

537
  public Rule withDependencies(List<String> dependencies) {
538
    this.dependencies = dependencies;
1✔
539
    return this;
1✔
540
  }
541

542
  public Rule withRulesAlreadyPassed(List<String> dependencies) {
543
    this.dependencies = dependencies;
×
544
    return this;
×
545
  }
546

547
  public Boolean getSkip() {
548
    return skip;
1✔
549
  }
550

551
  public void setSkip(Boolean skip) {
552
    this.skip = skip;
1✔
553
  }
1✔
554

555
  public Rule withSkip(Boolean skip) {
556
    this.skip = skip;
×
557
    return this;
×
558
  }
559

560
  public Boolean getDebug() {
561
    return debug;
1✔
562
  }
563

564
  public void setDebug(Boolean debug) {
565
    this.debug = debug;
1✔
566
  }
1✔
567

568
  public Rule withDebug(Boolean debug) {
569
    this.debug = debug;
×
570
    return this;
×
571
  }
572

573
  public Boolean getAllowEmptyInstances() {
574
    return allowEmptyInstances;
1✔
575
  }
576

577
  public void setAllowEmptyInstances(Boolean allowEmptyInstances) {
578
    this.allowEmptyInstances = allowEmptyInstances;
1✔
579
  }
1✔
580

581
  public Rule withAllowEmptyInstances(Boolean allowEmptyInstances) {
582
    this.allowEmptyInstances = allowEmptyInstances;
×
583
    return this;
×
584
  }
585

586
  public Boolean getMultilingual() {
587
    return multilingual;
1✔
588
  }
589

590
  public void setIsMultilingual(Boolean multilingual) {
591
    this.multilingual = multilingual;
1✔
592
  }
1✔
593

594
  public Rule withMultilingual(Boolean multilingual) {
595
    this.multilingual = multilingual;
×
596
    return this;
×
597
  }
598

599
  public ApplicationScope getHasLanguageTag() {
600
    return hasLanguageTag;
1✔
601
  }
602

603
  public void setHasLanguageTag(ApplicationScope hasLanguageTag) {
604
    this.hasLanguageTag = hasLanguageTag;
1✔
605
  }
1✔
606

607
  public Rule withHasLanguageTag(ApplicationScope hasLanguageTag) {
608
    this.hasLanguageTag = hasLanguageTag;
×
609
    return this;
×
610
  }
611

612
  public MQAFPattern getMqafPattern() {
613
    return mqafPattern;
1✔
614
  }
615

616
  public void setMqafPattern(MQAFPattern mqafPattern) {
617
    this.mqafPattern = mqafPattern;
×
618
  }
×
619

620
  public Rule withMqafPattern(MQAFPattern mqafPattern) {
621
    this.mqafPattern = mqafPattern;
×
622
    return this;
×
623
  }
624

625
  public String getValuePath() {
626
    return valuePath;
1✔
627
  }
628

629
  public void setValuePath(String valuePath) {
630
    this.valuePath = valuePath;
1✔
631
  }
1✔
632

633
  public Rule withValuePath(String valuePath) {
634
    this.valuePath = valuePath;
×
635
    return this;
×
636
  }
637

638
  public Integer getTimeout() {
639
    return timeout;
1✔
640
  }
641

642
  public void setTimeout(int timeout) {
643
    this.timeout = timeout;
×
644
  }
×
645

646
  public Rule withTimeout(int timeout) {
647
    this.timeout = timeout;
×
648
    return this;
×
649
  }
650

651
  @JsonGetter("alwaysCheckDependencies")
652
  public Boolean getAlwaysCheckDependencies() {
653
    return alwaysCheckDependencies;
1✔
654
  }
655

656
  public void setAlwaysCheckDependencies(Boolean alwaysCheckDependencies) {
657
    this.alwaysCheckDependencies = alwaysCheckDependencies;
1✔
658
  }
1✔
659

660
  public Rule withAlwaysCheckDependencies(Boolean alwaysCheckDependencies) {
661
    this.alwaysCheckDependencies = alwaysCheckDependencies;
×
662
    return this;
×
663
  }
664

665
  public Boolean getValidLink() {
666
    return validLink;
1✔
667
  }
668

669
  public void setValidLink(Boolean validLink) {
670
    this.validLink = validLink;
×
671
  }
×
672

673
  public Rule withValidLink(Boolean validLink) {
674
    this.validLink = validLink;
×
675
    return this;
×
676
  }
677

678
  public String getSkippableUrl() {
679
    return skippableUrl;
1✔
680
  }
681

682
  public void setSkippableUrl(String skippableUrl) {
683
    this.skippableUrl = skippableUrl;
×
684
  }
×
685

686
  public Rule withSkippableUrl(String skippableUrl) {
687
    this.skippableUrl = skippableUrl;
×
688
    return this;
×
689
  }
690

691
  public Boolean getPriorityOnFail() {
692
    return priorityOnFail;
1✔
693
  }
694

695
  public void setPriorityOnFail(Boolean priorityOnFail) {
696
    this.priorityOnFail = priorityOnFail;
×
697
  }
×
698

699
  public Rule withPriorityOnFail(Boolean priorityOnFail) {
700
    this.priorityOnFail = priorityOnFail;
×
701
    return this;
×
702
  }
703

704
  public Boolean getParentCheck() {
705
    return parentCheck;
1✔
706
  }
707

708
  public void setParentCheck(Boolean parentCheck) {
NEW
709
    this.parentCheck = parentCheck;
×
NEW
710
  }
×
711

712
  public Rule withParentCheck(Boolean parentCheck) {
NEW
713
    this.parentCheck = parentCheck;
×
NEW
714
    return this;
×
715
  }
716

717
  public Boolean getNaIfNoParent() {
718
    return naIfNoParent;
1✔
719
  }
720

721
  public void setNaIfNoParent(Boolean naIfNoParent) {
NEW
722
    this.naIfNoParent = naIfNoParent;
×
NEW
723
  }
×
724

725
  public Rule withNaIfNoParent(Boolean naIfNoParent) {
NEW
726
    this.naIfNoParent = naIfNoParent;
×
NEW
727
    return this;
×
728
  }
729

730
  @JsonIgnore
731
  public List<String> getRulenames() {
732
    List<String> excludeFromComparision = List.of("serialVersionUID", "id", "description",
1✔
733
      "failureScore", "successScore", "naScore", "hidden", "dependencies", "skip", "debug", "allowEmptyInstances");
734

735
    List<String> existingRules = new ArrayList<>();
1✔
736
    for (Field field : getClass().getDeclaredFields()) {
1✔
737
      if (!excludeFromComparision.contains(field.getName())) {
1✔
738
        field.setAccessible(true);
1✔
739
        try {
740
          Object value = field.get(this);
1✔
741
          if (value != null)
1✔
742
            existingRules.add(field.getName());
1✔
743
        } catch (IllegalAccessException e) {
×
744
          throw new RuntimeException(e);
×
745
        }
1✔
746
      }
747
    }
748
    return existingRules;
1✔
749
  }
750

751
  public Object get(String key) {
752
    for (Field field : getClass().getDeclaredFields()) {
1✔
753
      if (field.getName().equals(key)) {
1✔
754
        try {
755
          return field.get(this);
1✔
756
        } catch (IllegalAccessException e) {
×
757
          throw new RuntimeException(e);
×
758
        }
759
      }
760
    }
761
    return null;
×
762
  }
763

764
  public void set(String key, Object value) {
765
    for (Field field : getClass().getDeclaredFields()) {
1✔
766
      if (field.getName().equals(key)) {
1✔
767
        try {
768
          field.set(this, value);
1✔
769
        } catch (IllegalAccessException e) {
×
770
          throw new RuntimeException(e);
×
771
        }
1✔
772
      }
773
    }
774
  }
1✔
775

776
}
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