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

pmd / pmd / 22

30 May 2025 01:19PM UTC coverage: 78.601% (+0.8%) from 77.795%
22

push

github

adangel
[core] Reformat SarifLog to comply to coding standards (#5748)

Merge pull request #5748 from adangel:core/cleanup-sariflog

17714 of 23362 branches covered (75.82%)

Branch coverage included in aggregate %.

34 of 104 new or added lines in 1 file covered. (32.69%)

217 existing lines in 2 files now uncovered.

38811 of 48552 relevant lines covered (79.94%)

0.81 hits per line

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

35.82
/pmd-core/src/main/java/net/sourceforge/pmd/renderers/internal/sarif/SarifLog.java
1
/*
2
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3
 */
4

5
package net.sourceforge.pmd.renderers.internal.sarif;
6

7
import java.util.ArrayList;
8
import java.util.Collection;
9
import java.util.Collections;
10
import java.util.List;
11
import java.util.Objects;
12
import java.util.Set;
13

14
import com.google.gson.annotations.SerializedName;
15

16
/**
17
 * This class represents a SARIF report that can be serialized with Gson into Json.
18
 *
19
 * <p>To create a new log, use the builders, e.g. {@link SarifLog#builder()}.
20
 * <p>This class tries to use the same names as in the official specification for
21
 * Sarif.
22
 *
23
 * @see <a href="https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html">Static Analysis Results Interchange Format (SARIF) Version 2.1.0</a>
24
 */
25
public final class SarifLog {
26
    @SerializedName("$schema")
27
    private String schema;
28
    private String version;
29
    private List<Run> runs;
30

31
    /**
32
     * A location within a programming artifact.
33
     */
34
    public static final class Location {
35
        private Integer id;
36
        private PhysicalLocation physicalLocation;
37

38
        private Location(final Integer id, final PhysicalLocation physicalLocation) {
1✔
39
            this.id = id;
1✔
40
            this.physicalLocation = physicalLocation;
1✔
41
        }
1✔
42

43
        public static final class LocationBuilder {
44
            private Integer id;
45
            private PhysicalLocation physicalLocation;
46

47
            private LocationBuilder() {
48
                // make default ctor private; factory method Location#builder() should be used.
49
            }
50

51
            /**
52
             * Value that distinguishes this location from all other locations within a single result object.
53
             *
54
             * @return {@code this}.
55
             */
56
            public SarifLog.Location.LocationBuilder id(final Integer id) {
UNCOV
57
                this.id = id;
×
58
                return this;
×
59
            }
60

61
            /**
62
             * Identifies the artifact and region.
63
             *
64
             * @return {@code this}.
65
             */
66
            public SarifLog.Location.LocationBuilder physicalLocation(final PhysicalLocation physicalLocation) {
67
                this.physicalLocation = physicalLocation;
1✔
68
                return this;
1✔
69
            }
70

71
            public SarifLog.Location build() {
72
                return new SarifLog.Location(this.id, this.physicalLocation);
1✔
73
            }
74

75
            @Override
76
            public String toString() {
UNCOV
77
                return "SarifLog.Location.LocationBuilder(id=" + this.id + ", physicalLocation=" + this.physicalLocation + ")";
×
78
            }
79
        }
80

81
        public static SarifLog.Location.LocationBuilder builder() {
82
            return new SarifLog.Location.LocationBuilder();
1✔
83
        }
84

85
        /**
86
         * Value that distinguishes this location from all other locations within a single result object.
87
         */
88
        public Integer getId() {
UNCOV
89
            return this.id;
×
90
        }
91

92
        /**
93
         * Identifies the artifact and region.
94
         */
95
        public PhysicalLocation getPhysicalLocation() {
UNCOV
96
            return this.physicalLocation;
×
97
        }
98

99
        /**
100
         * Value that distinguishes this location from all other locations within a single result object.
101
         *
102
         * @return {@code this}.
103
         */
104
        public SarifLog.Location setId(final Integer id) {
UNCOV
105
            this.id = id;
×
106
            return this;
×
107
        }
108

109
        /**
110
         * Identifies the artifact and region.
111
         *
112
         * @return {@code this}.
113
         */
114
        public SarifLog.Location setPhysicalLocation(final PhysicalLocation physicalLocation) {
UNCOV
115
            this.physicalLocation = physicalLocation;
×
116
            return this;
×
117
        }
118

119
        @Override
120
        public boolean equals(Object o) {
NEW
121
            if (o == null || getClass() != o.getClass()) {
×
UNCOV
122
                return false;
×
123
            }
NEW
124
            Location location = (Location) o;
×
NEW
125
            return Objects.equals(id, location.id) && Objects.equals(physicalLocation, location.physicalLocation);
×
126
        }
127

128
        @Override
129
        public int hashCode() {
NEW
130
            return Objects.hash(id, physicalLocation);
×
131
        }
132

133
        @Override
134
        public String toString() {
UNCOV
135
            return "SarifLog.Location(id=" + this.getId() + ", physicalLocation=" + this.getPhysicalLocation() + ")";
×
136
        }
137
    }
138

139

140
    /**
141
     * Specifies the location of an artifact.
142
     */
143
    public static final class ArtifactLocation {
144
        private String uri;
145
        private String uriBaseId;
146
        private Integer index;
147

148
        private ArtifactLocation(final String uri, final String uriBaseId, final Integer index) {
1✔
149
            this.uri = uri;
1✔
150
            this.uriBaseId = uriBaseId;
1✔
151
            this.index = index;
1✔
152
        }
1✔
153

154
        public static final class ArtifactLocationBuilder {
155
            private String uri;
156
            private String uriBaseId;
157
            private Integer index;
158

159
            private ArtifactLocationBuilder() {
160
                // make default ctor private. Use factory method ArtifactLocation#builder() instead.
161
            }
162

163
            /**
164
             * A string containing a valid relative or absolute URI.
165
             *
166
             * @return {@code this}.
167
             */
168
            public SarifLog.ArtifactLocation.ArtifactLocationBuilder uri(final String uri) {
169
                this.uri = uri;
1✔
170
                return this;
1✔
171
            }
172

173
            /**
174
             * A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" property
175
             * is interpreted.
176
             *
177
             * @return {@code this}.
178
             */
179
            public SarifLog.ArtifactLocation.ArtifactLocationBuilder uriBaseId(final String uriBaseId) {
UNCOV
180
                this.uriBaseId = uriBaseId;
×
181
                return this;
×
182
            }
183

184
            /**
185
             * The index within the run artifacts array of the artifact object associated with the artifact location.
186
             *
187
             * @return {@code this}.
188
             */
189
            public SarifLog.ArtifactLocation.ArtifactLocationBuilder index(final Integer index) {
UNCOV
190
                this.index = index;
×
191
                return this;
×
192
            }
193

194
            public SarifLog.ArtifactLocation build() {
195
                return new SarifLog.ArtifactLocation(this.uri, this.uriBaseId, this.index);
1✔
196
            }
197

198
            @Override
199
            public String toString() {
UNCOV
200
                return "SarifLog.ArtifactLocation.ArtifactLocationBuilder(uri=" + this.uri + ", uriBaseId=" + this.uriBaseId + ", index=" + this.index + ")";
×
201
            }
202
        }
203

204
        public static SarifLog.ArtifactLocation.ArtifactLocationBuilder builder() {
205
            return new SarifLog.ArtifactLocation.ArtifactLocationBuilder();
1✔
206
        }
207

208
        /**
209
         * A string containing a valid relative or absolute URI.
210
         */
211
        public String getUri() {
UNCOV
212
            return this.uri;
×
213
        }
214

215
        /**
216
         * A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" property
217
         * is interpreted.
218
         */
219
        public String getUriBaseId() {
UNCOV
220
            return this.uriBaseId;
×
221
        }
222

223
        /**
224
         * The index within the run artifacts array of the artifact object associated with the artifact location.
225
         */
226
        public Integer getIndex() {
UNCOV
227
            return this.index;
×
228
        }
229

230
        /**
231
         * A string containing a valid relative or absolute URI.
232
         *
233
         * @return {@code this}.
234
         */
235
        public SarifLog.ArtifactLocation setUri(final String uri) {
UNCOV
236
            this.uri = uri;
×
237
            return this;
×
238
        }
239

240
        /**
241
         * A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" property
242
         * is interpreted.
243
         *
244
         * @return {@code this}.
245
         */
246
        public SarifLog.ArtifactLocation setUriBaseId(final String uriBaseId) {
UNCOV
247
            this.uriBaseId = uriBaseId;
×
248
            return this;
×
249
        }
250

251
        /**
252
         * The index within the run artifacts array of the artifact object associated with the artifact location.
253
         *
254
         * @return {@code this}.
255
         */
256
        public SarifLog.ArtifactLocation setIndex(final Integer index) {
UNCOV
257
            this.index = index;
×
258
            return this;
×
259
        }
260

261
        @Override
262
        public boolean equals(Object o) {
NEW
263
            if (o == null || getClass() != o.getClass()) {
×
UNCOV
264
                return false;
×
265
            }
NEW
266
            ArtifactLocation that = (ArtifactLocation) o;
×
NEW
267
            return Objects.equals(uri, that.uri) && Objects.equals(uriBaseId, that.uriBaseId) && Objects.equals(index, that.index);
×
268
        }
269

270
        @Override
271
        public int hashCode() {
NEW
272
            return Objects.hash(uri, uriBaseId, index);
×
273
        }
274

275
        @Override
276
        public String toString() {
UNCOV
277
            return "SarifLog.ArtifactLocation(uri=" + this.getUri() + ", uriBaseId=" + this.getUriBaseId() + ", index=" + this.getIndex() + ")";
×
278
        }
279
    }
280

281

282
    /**
283
     * A physical location relevant to a result. Specifies a reference to a programming artifact together with a range
284
     * of bytes or characters within that artifact.
285
     */
286
    public static final class PhysicalLocation {
287
        private ArtifactLocation artifactLocation;
288
        private Region region;
289

290
        private PhysicalLocation(final ArtifactLocation artifactLocation, final Region region) {
1✔
291
            this.artifactLocation = artifactLocation;
1✔
292
            this.region = region;
1✔
293
        }
1✔
294

295

296
        public static final class PhysicalLocationBuilder {
297
            private ArtifactLocation artifactLocation;
298
            private Region region;
299

300
            private PhysicalLocationBuilder() {
301
                // make default ctor private; use factory method PhysicalLocation#builder() instead.
302
            }
303

304
            /**
305
             * The location of the artifact.
306
             *
307
             * @return {@code this}.
308
             */
309
            public SarifLog.PhysicalLocation.PhysicalLocationBuilder artifactLocation(final ArtifactLocation artifactLocation) {
310
                this.artifactLocation = artifactLocation;
1✔
311
                return this;
1✔
312
            }
313

314
            /**
315
             * Specifies a portion of the artifact.
316
             *
317
             * @return {@code this}.
318
             */
319
            public SarifLog.PhysicalLocation.PhysicalLocationBuilder region(final Region region) {
320
                this.region = region;
1✔
321
                return this;
1✔
322
            }
323

324
            public SarifLog.PhysicalLocation build() {
325
                return new SarifLog.PhysicalLocation(this.artifactLocation, this.region);
1✔
326
            }
327

328
            @Override
329
            public String toString() {
UNCOV
330
                return "SarifLog.PhysicalLocation.PhysicalLocationBuilder(artifactLocation=" + this.artifactLocation + ", region=" + this.region + ")";
×
331
            }
332
        }
333

334
        public static SarifLog.PhysicalLocation.PhysicalLocationBuilder builder() {
335
            return new SarifLog.PhysicalLocation.PhysicalLocationBuilder();
1✔
336
        }
337

338
        /**
339
         * The location of the artifact.
340
         */
341
        public ArtifactLocation getArtifactLocation() {
UNCOV
342
            return this.artifactLocation;
×
343
        }
344

345
        /**
346
         * Specifies a portion of the artifact.
347
         */
348
        public Region getRegion() {
UNCOV
349
            return this.region;
×
350
        }
351

352
        /**
353
         * The location of the artifact.
354
         *
355
         * @return {@code this}.
356
         */
357
        public SarifLog.PhysicalLocation setArtifactLocation(final ArtifactLocation artifactLocation) {
UNCOV
358
            this.artifactLocation = artifactLocation;
×
359
            return this;
×
360
        }
361

362
        /**
363
         * Specifies a portion of the artifact.
364
         *
365
         * @return {@code this}.
366
         */
367
        public SarifLog.PhysicalLocation setRegion(final Region region) {
UNCOV
368
            this.region = region;
×
369
            return this;
×
370
        }
371

372
        @Override
373
        public boolean equals(Object o) {
NEW
374
            if (o == null || getClass() != o.getClass()) {
×
UNCOV
375
                return false;
×
376
            }
NEW
377
            PhysicalLocation that = (PhysicalLocation) o;
×
NEW
378
            return Objects.equals(artifactLocation, that.artifactLocation) && Objects.equals(region, that.region);
×
379
        }
380

381
        @Override
382
        public int hashCode() {
NEW
383
            return Objects.hash(artifactLocation, region);
×
384
        }
385

386
        @Override
387
        public String toString() {
UNCOV
388
            return "SarifLog.PhysicalLocation(artifactLocation=" + this.getArtifactLocation() + ", region=" + this.getRegion() + ")";
×
389
        }
390
    }
391

392
    /**
393
     * Key/value pairs that provide additional information about the object.
394
     */
395
    public static final class PropertyBag {
396
        private String ruleset;
397
        private Integer priority;
398
        private Set<String> tags;
399

400
        private PropertyBag(final String ruleset, final Integer priority, final Set<String> tags) {
1✔
401
            this.ruleset = ruleset;
1✔
402
            this.priority = priority;
1✔
403
            this.tags = tags;
1✔
404
        }
1✔
405

406

407
        public static final class PropertyBagBuilder {
408
            private String ruleset;
409
            private Integer priority;
410
            private Set<String> tags;
411

412
            private PropertyBagBuilder() {
413
                // make default ctor private; use factoy method PropertyBag#builder() instead.
414
            }
415

416
            /**
417
             * The name of the rule set.
418
             *
419
             * @return {@code this}.
420
             */
421
            public SarifLog.PropertyBag.PropertyBagBuilder ruleset(final String ruleset) {
422
                this.ruleset = ruleset;
1✔
423
                return this;
1✔
424
            }
425

426
            /**
427
             * The pmd priority of the rule.
428
             *
429
             * @return {@code this}.
430
             */
431
            public SarifLog.PropertyBag.PropertyBagBuilder priority(final Integer priority) {
432
                this.priority = priority;
1✔
433
                return this;
1✔
434
            }
435

436
            /**
437
             * A set of distinct strings that provide additional information. This is SARIF 2.1.0 Schema.
438
             *
439
             * @return {@code this}.
440
             */
441
            public SarifLog.PropertyBag.PropertyBagBuilder tags(final Set<String> tags) {
442
                this.tags = tags;
1✔
443
                return this;
1✔
444
            }
445

446
            public SarifLog.PropertyBag build() {
447
                return new SarifLog.PropertyBag(this.ruleset, this.priority, this.tags);
1✔
448
            }
449

450
            @Override
451
            public String toString() {
UNCOV
452
                return "SarifLog.PropertyBag.PropertyBagBuilder(ruleset=" + this.ruleset + ", priority=" + this.priority + ", tags=" + this.tags + ")";
×
453
            }
454
        }
455

456
        public static SarifLog.PropertyBag.PropertyBagBuilder builder() {
457
            return new SarifLog.PropertyBag.PropertyBagBuilder();
1✔
458
        }
459

460
        /**
461
         * The name of the rule set.
462
         */
463
        public String getRuleset() {
UNCOV
464
            return this.ruleset;
×
465
        }
466

467
        /**
468
         * The pmd priority of the rule.
469
         */
470
        public Integer getPriority() {
UNCOV
471
            return this.priority;
×
472
        }
473

474
        /**
475
         * A set of distinct strings that provide additional information. This is SARIF 2.1.0 Schema.
476
         */
477
        public Set<String> getTags() {
UNCOV
478
            return this.tags;
×
479
        }
480

481
        /**
482
         * The name of the rule set.
483
         *
484
         * @return {@code this}.
485
         */
486
        public SarifLog.PropertyBag setRuleset(final String ruleset) {
UNCOV
487
            this.ruleset = ruleset;
×
488
            return this;
×
489
        }
490

491
        /**
492
         * The pmd priority of the rule.
493
         *
494
         * @return {@code this}.
495
         */
496
        public SarifLog.PropertyBag setPriority(final Integer priority) {
UNCOV
497
            this.priority = priority;
×
498
            return this;
×
499
        }
500

501
        /**
502
         * The set of distinct strings that provide additional information. This is SARIF 2.1.0 Schema.
503
         *
504
         * @return {@code this}.
505
         */
506
        public SarifLog.PropertyBag setTags(final Set<String> tags) {
UNCOV
507
            this.tags = tags;
×
508
            return this;
×
509
        }
510

511
        @Override
512
        public boolean equals(Object o) {
513
            if (o == null || getClass() != o.getClass()) {
1!
UNCOV
514
                return false;
×
515
            }
516
            PropertyBag that = (PropertyBag) o;
1✔
517
            return Objects.equals(ruleset, that.ruleset) && Objects.equals(priority, that.priority) && Objects.equals(tags, that.tags);
1!
518
        }
519

520
        @Override
521
        public int hashCode() {
NEW
522
            return Objects.hash(ruleset, priority, tags);
×
523
        }
524

525
        @Override
526
        public String toString() {
UNCOV
527
            return "SarifLog.PropertyBag(ruleset=" + this.getRuleset() + ", priority=" + this.getPriority() + ", tags=" + this.getTags() + ")";
×
528
        }
529
    }
530

531

532
    /**
533
     * A region within an artifact where a result was detected.
534
     */
535
    public static final class Region {
536
        private Integer startLine;
537
        private Integer startColumn;
538
        private Integer endLine;
539
        private Integer endColumn;
540

541
        private Region(final Integer startLine, final Integer startColumn, final Integer endLine, final Integer endColumn) {
1✔
542
            this.startLine = startLine;
1✔
543
            this.startColumn = startColumn;
1✔
544
            this.endLine = endLine;
1✔
545
            this.endColumn = endColumn;
1✔
546
        }
1✔
547

548

549
        public static final class RegionBuilder {
550
            private Integer startLine;
551
            private Integer startColumn;
552
            private Integer endLine;
553
            private Integer endColumn;
554

555
            private RegionBuilder() {
556
                // make default ctor private; use factory method Region#builder() instead.
557
            }
558

559
            /**
560
             * The line number of the first character in the region.
561
             *
562
             * @return {@code this}.
563
             */
564
            public SarifLog.Region.RegionBuilder startLine(final Integer startLine) {
565
                this.startLine = startLine;
1✔
566
                return this;
1✔
567
            }
568

569
            /**
570
             * The column number of the first character in the region.
571
             *
572
             * @return {@code this}.
573
             */
574
            public SarifLog.Region.RegionBuilder startColumn(final Integer startColumn) {
575
                this.startColumn = startColumn;
1✔
576
                return this;
1✔
577
            }
578

579
            /**
580
             * The line number of the last character in the region.
581
             *
582
             * @return {@code this}.
583
             */
584
            public SarifLog.Region.RegionBuilder endLine(final Integer endLine) {
585
                this.endLine = endLine;
1✔
586
                return this;
1✔
587
            }
588

589
            /**
590
             * The column number of the character following the end of the region.
591
             *
592
             * @return {@code this}.
593
             */
594
            public SarifLog.Region.RegionBuilder endColumn(final Integer endColumn) {
595
                this.endColumn = endColumn;
1✔
596
                return this;
1✔
597
            }
598

599
            public SarifLog.Region build() {
600
                return new SarifLog.Region(this.startLine, this.startColumn, this.endLine, this.endColumn);
1✔
601
            }
602

603
            @Override
604
            public String toString() {
UNCOV
605
                return "SarifLog.Region.RegionBuilder(startLine=" + this.startLine + ", startColumn=" + this.startColumn + ", endLine=" + this.endLine + ", endColumn=" + this.endColumn + ")";
×
606
            }
607
        }
608

609
        public static SarifLog.Region.RegionBuilder builder() {
610
            return new SarifLog.Region.RegionBuilder();
1✔
611
        }
612

613
        /**
614
         * The line number of the first character in the region.
615
         */
616
        public Integer getStartLine() {
UNCOV
617
            return this.startLine;
×
618
        }
619

620
        /**
621
         * The column number of the first character in the region.
622
         */
623
        public Integer getStartColumn() {
UNCOV
624
            return this.startColumn;
×
625
        }
626

627
        /**
628
         * The line number of the last character in the region.
629
         */
630
        public Integer getEndLine() {
UNCOV
631
            return this.endLine;
×
632
        }
633

634
        /**
635
         * The column number of the character following the end of the region.
636
         */
637
        public Integer getEndColumn() {
UNCOV
638
            return this.endColumn;
×
639
        }
640

641
        /**
642
         * The line number of the first character in the region.
643
         *
644
         * @return {@code this}.
645
         */
646
        public SarifLog.Region setStartLine(final Integer startLine) {
UNCOV
647
            this.startLine = startLine;
×
648
            return this;
×
649
        }
650

651
        /**
652
         * The column number of the first character in the region.
653
         *
654
         * @return {@code this}.
655
         */
656
        public SarifLog.Region setStartColumn(final Integer startColumn) {
UNCOV
657
            this.startColumn = startColumn;
×
658
            return this;
×
659
        }
660

661
        /**
662
         * The line number of the last character in the region.
663
         *
664
         * @return {@code this}.
665
         */
666
        public SarifLog.Region setEndLine(final Integer endLine) {
UNCOV
667
            this.endLine = endLine;
×
668
            return this;
×
669
        }
670

671
        /**
672
         * The column number of the character following the end of the region.
673
         *
674
         * @return {@code this}.
675
         */
676
        public SarifLog.Region setEndColumn(final Integer endColumn) {
UNCOV
677
            this.endColumn = endColumn;
×
678
            return this;
×
679
        }
680

681
        @Override
682
        public boolean equals(Object o) {
NEW
683
            if (o == null || getClass() != o.getClass()) {
×
UNCOV
684
                return false;
×
685
            }
NEW
686
            Region region = (Region) o;
×
NEW
687
            return Objects.equals(startLine, region.startLine) && Objects.equals(startColumn, region.startColumn) && Objects.equals(endLine, region.endLine) && Objects.equals(endColumn, region.endColumn);
×
688
        }
689

690
        @Override
691
        public int hashCode() {
NEW
692
            return Objects.hash(startLine, startColumn, endLine, endColumn);
×
693
        }
694

695
        @Override
696
        public String toString() {
UNCOV
697
            return "SarifLog.Region(startLine=" + this.getStartLine() + ", startColumn=" + this.getStartColumn() + ", endLine=" + this.getEndLine() + ", endColumn=" + this.getEndColumn() + ")";
×
698
        }
699
    }
700

701

702
    /**
703
     * A result produced by an analysis tool.
704
     */
705
    public static final class Result {
706
        private String ruleId;
707
        private Integer ruleIndex;
708
        private Message message;
709
        private String level;
710
        private List<Location> locations;
711
        private PropertyBag properties;
712

713
        private Result(final String ruleId, final Integer ruleIndex, final Message message, final String level, final List<Location> locations, final PropertyBag properties) {
1✔
714
            this.ruleId = ruleId;
1✔
715
            this.ruleIndex = ruleIndex;
1✔
716
            this.message = message;
1✔
717
            this.level = level;
1✔
718
            this.locations = locations;
1✔
719
            this.properties = properties;
1✔
720
        }
1✔
721

722

723
        public static final class ResultBuilder {
724
            private String ruleId;
725
            private Integer ruleIndex;
726
            private Message message;
727
            private String level;
728
            private List<Location> locations;
729
            private PropertyBag properties;
730

731
            private ResultBuilder() {
732
                // make default ctor private; use factory method Result#builder() instead.
733
            }
734

735
            /**
736
             * The stable, unique identifier of the rule, if any, to which this result is relevant.
737
             *
738
             * @return {@code this}.
739
             */
740
            public SarifLog.Result.ResultBuilder ruleId(final String ruleId) {
741
                this.ruleId = ruleId;
1✔
742
                return this;
1✔
743
            }
744

745
            /**
746
             * The index link the rule, if any, to which this result is relevant.
747
             *
748
             * @return {@code this}.
749
             */
750
            public SarifLog.Result.ResultBuilder ruleIndex(final Integer ruleIndex) {
751
                this.ruleIndex = ruleIndex;
1✔
752
                return this;
1✔
753
            }
754

755
            /**
756
             * A message that describes the result. The first sentence of the message only will be displayed when visible
757
             * space is limited.
758
             *
759
             * @return {@code this}.
760
             */
761
            public SarifLog.Result.ResultBuilder message(final Message message) {
UNCOV
762
                this.message = message;
×
763
                return this;
×
764
            }
765

766
            /**
767
             * Specifies the severity level of the result. It is derived from PMD's defined rule priorities (1,2 = error, 3 = warning, 4,5 = note).
768
             *
769
             * @return {@code this}.
770
             * @see net.sourceforge.pmd.lang.rule.RulePriority
771
             */
772
            public SarifLog.Result.ResultBuilder level(final String level) {
773
                this.level = level;
1✔
774
                return this;
1✔
775
            }
776

777
            /**
778
             * The set of locations where the result was detected. Specify only one location unless the problem indicated by
779
             * the result can only be corrected by making a change at every specified location.
780
             *
781
             * @return {@code this}.
782
             */
783
            public SarifLog.Result.ResultBuilder locations(final List<Location> locations) {
UNCOV
784
                this.locations = locations;
×
785
                return this;
×
786
            }
787

788
            /**
789
             * Key/value pairs that provide additional information about the address.
790
             *
791
             * @return {@code this}.
792
             */
793
            public SarifLog.Result.ResultBuilder properties(final PropertyBag properties) {
UNCOV
794
                this.properties = properties;
×
795
                return this;
×
796
            }
797

798
            public SarifLog.Result build() {
799
                return new SarifLog.Result(this.ruleId, this.ruleIndex, this.message, this.level, this.locations, this.properties);
1✔
800
            }
801

802
            @Override
803
            public String toString() {
UNCOV
804
                return "SarifLog.Result.ResultBuilder(ruleId=" + this.ruleId + ", ruleIndex=" + this.ruleIndex + ", message=" + this.message + ", level=" + this.level + ", locations=" + this.locations + ", properties=" + this.properties + ")";
×
805
            }
806
        }
807

808
        public static SarifLog.Result.ResultBuilder builder() {
809
            return new SarifLog.Result.ResultBuilder();
1✔
810
        }
811

812
        /**
813
         * The stable, unique identifier of the rule, if any, to which this result is relevant.
814
         */
815
        public String getRuleId() {
UNCOV
816
            return this.ruleId;
×
817
        }
818

819
        /**
820
         * The index link the rule, if any, to which this result is relevant.
821
         */
822
        public Integer getRuleIndex() {
UNCOV
823
            return this.ruleIndex;
×
824
        }
825

826
        /**
827
         * A message that describes the result. The first sentence of the message only will be displayed when visible
828
         * space is limited.
829
         */
830
        public Message getMessage() {
UNCOV
831
            return this.message;
×
832
        }
833

834
        /**
835
         * Specifies the severity level of the result. It is derived from PMD's defined rule priorities (1,2 = error, 3 = warning, 4,5 = note).
836
         *
837
         * @see net.sourceforge.pmd.lang.rule.RulePriority
838
         */
839
        public String getLevel() {
UNCOV
840
            return this.level;
×
841
        }
842

843
        /**
844
         * The set of locations where the result was detected. Specify only one location unless the problem indicated by
845
         * the result can only be corrected by making a change at every specified location.
846
         */
847
        public List<Location> getLocations() {
UNCOV
848
            return this.locations;
×
849
        }
850

851
        /**
852
         * Key/value pairs that provide additional information about the address.
853
         */
854
        public PropertyBag getProperties() {
UNCOV
855
            return this.properties;
×
856
        }
857

858
        /**
859
         * The stable, unique identifier of the rule, if any, to which this result is relevant.
860
         *
861
         * @return {@code this}.
862
         */
863
        public SarifLog.Result setRuleId(final String ruleId) {
UNCOV
864
            this.ruleId = ruleId;
×
865
            return this;
×
866
        }
867

868
        /**
869
         * The index link the rule, if any, to which this result is relevant.
870
         *
871
         * @return {@code this}.
872
         */
873
        public SarifLog.Result setRuleIndex(final Integer ruleIndex) {
UNCOV
874
            this.ruleIndex = ruleIndex;
×
875
            return this;
×
876
        }
877

878
        /**
879
         * A message that describes the result. The first sentence of the message only will be displayed when visible
880
         * space is limited.
881
         *
882
         * @return {@code this}.
883
         */
884
        public SarifLog.Result setMessage(final Message message) {
885
            this.message = message;
1✔
886
            return this;
1✔
887
        }
888

889
        /**
890
         * Specifies the severity level of the result. It is derived from PMD's defined rule priorities (1,2 = error, 3 = warning, 4,5 = note).
891
         *
892
         * @return {@code this}.
893
         * @see net.sourceforge.pmd.lang.rule.RulePriority
894
         */
895
        public SarifLog.Result setLevel(final String level) {
UNCOV
896
            this.level = level;
×
897
            return this;
×
898
        }
899

900
        /**
901
         * The set of locations where the result was detected. Specify only one location unless the problem indicated by
902
         * the result can only be corrected by making a change at every specified location.
903
         *
904
         * @return {@code this}.
905
         */
906
        public SarifLog.Result setLocations(final List<Location> locations) {
907
            this.locations = locations;
1✔
908
            return this;
1✔
909
        }
910

911
        /**
912
         * Key/value pairs that provide additional information about the address.
913
         *
914
         * @return {@code this}.
915
         */
916
        public SarifLog.Result setProperties(final PropertyBag properties) {
UNCOV
917
            this.properties = properties;
×
918
            return this;
×
919
        }
920

921
        @Override
922
        public boolean equals(Object o) {
NEW
923
            if (o == null || getClass() != o.getClass()) {
×
UNCOV
924
                return false;
×
925
            }
NEW
926
            Result result = (Result) o;
×
NEW
927
            return Objects.equals(ruleId, result.ruleId) && Objects.equals(ruleIndex, result.ruleIndex) && Objects.equals(message, result.message) && Objects.equals(level, result.level) && Objects.equals(locations, result.locations) && Objects.equals(properties, result.properties);
×
928
        }
929

930
        @Override
931
        public int hashCode() {
NEW
932
            return Objects.hash(ruleId, ruleIndex, message, level, locations, properties);
×
933
        }
934

935
        @Override
936
        public String toString() {
UNCOV
937
            return "SarifLog.Result(ruleId=" + this.getRuleId() + ", ruleIndex=" + this.getRuleIndex() + ", message=" + this.getMessage() + ", level=" + this.getLevel() + ", locations=" + this.getLocations() + ", properties=" + this.getProperties() + ")";
×
938
        }
939
    }
940

941

942
    /**
943
     * Encapsulates a message intended to be read by the end user.
944
     */
945
    public static final class Message {
946
        private String text;
947
        private String markdown;
948
        private String id;
949

950
        private Message(final String text, final String markdown, final String id) {
1✔
951
            this.text = text;
1✔
952
            this.markdown = markdown;
1✔
953
            this.id = id;
1✔
954
        }
1✔
955

956

957
        public static final class MessageBuilder {
958
            private String text;
959
            private String markdown;
960
            private String id;
961

962
            private MessageBuilder() {
963
                // make default ctor private; use factory method Message#builder() instead.
964
            }
965

966
            /**
967
             * A plain text message string.
968
             *
969
             * @return {@code this}.
970
             */
971
            public SarifLog.Message.MessageBuilder text(final String text) {
972
                this.text = text;
1✔
973
                return this;
1✔
974
            }
975

976
            /**
977
             * A Markdown message string.
978
             *
979
             * @return {@code this}.
980
             */
981
            public SarifLog.Message.MessageBuilder markdown(final String markdown) {
UNCOV
982
                this.markdown = markdown;
×
983
                return this;
×
984
            }
985

986
            /**
987
             * The identifier for this message.
988
             *
989
             * @return {@code this}.
990
             */
991
            public SarifLog.Message.MessageBuilder id(final String id) {
UNCOV
992
                this.id = id;
×
993
                return this;
×
994
            }
995

996
            public SarifLog.Message build() {
997
                return new SarifLog.Message(this.text, this.markdown, this.id);
1✔
998
            }
999

1000
            @Override
1001
            public String toString() {
UNCOV
1002
                return "SarifLog.Message.MessageBuilder(text=" + this.text + ", markdown=" + this.markdown + ", id=" + this.id + ")";
×
1003
            }
1004
        }
1005

1006
        public static SarifLog.Message.MessageBuilder builder() {
1007
            return new SarifLog.Message.MessageBuilder();
1✔
1008
        }
1009

1010
        /**
1011
         * A plain text message string.
1012
         */
1013
        public String getText() {
UNCOV
1014
            return this.text;
×
1015
        }
1016

1017
        /**
1018
         * A Markdown message string.
1019
         */
1020
        public String getMarkdown() {
UNCOV
1021
            return this.markdown;
×
1022
        }
1023

1024
        /**
1025
         * The identifier for this message.
1026
         */
1027
        public String getId() {
UNCOV
1028
            return this.id;
×
1029
        }
1030

1031
        /**
1032
         * A plain text message string.
1033
         *
1034
         * @return {@code this}.
1035
         */
1036
        public SarifLog.Message setText(final String text) {
UNCOV
1037
            this.text = text;
×
1038
            return this;
×
1039
        }
1040

1041
        /**
1042
         * A Markdown message string.
1043
         *
1044
         * @return {@code this}.
1045
         */
1046
        public SarifLog.Message setMarkdown(final String markdown) {
UNCOV
1047
            this.markdown = markdown;
×
1048
            return this;
×
1049
        }
1050

1051
        /**
1052
         * The identifier for this message.
1053
         *
1054
         * @return {@code this}.
1055
         */
1056
        public SarifLog.Message setId(final String id) {
UNCOV
1057
            this.id = id;
×
1058
            return this;
×
1059
        }
1060

1061
        @Override
1062
        public boolean equals(Object o) {
NEW
1063
            if (o == null || getClass() != o.getClass()) {
×
UNCOV
1064
                return false;
×
1065
            }
NEW
1066
            Message message = (Message) o;
×
NEW
1067
            return Objects.equals(text, message.text) && Objects.equals(markdown, message.markdown) && Objects.equals(id, message.id);
×
1068
        }
1069

1070
        @Override
1071
        public int hashCode() {
NEW
1072
            return Objects.hash(text, markdown, id);
×
1073
        }
1074

1075
        @Override
1076
        public String toString() {
UNCOV
1077
            return "SarifLog.Message(text=" + this.getText() + ", markdown=" + this.getMarkdown() + ", id=" + this.getId() + ")";
×
1078
        }
1079
    }
1080

1081

1082
    /**
1083
     * Describes a single run of an analysis tool, and contains the reported output of that run.
1084
     */
1085
    public static final class Run {
1086
        private Tool tool;
1087
        private List<Result> results;
1088
        private List<Invocation> invocations;
1089

1090
        private Run(final Tool tool, final List<Result> results, final List<Invocation> invocations) {
1✔
1091
            this.tool = tool;
1✔
1092
            this.results = results;
1✔
1093
            this.invocations = invocations;
1✔
1094
        }
1✔
1095

1096

1097
        public static final class RunBuilder {
1098
            private Tool tool;
1099
            private List<Result> results;
1100
            private List<Invocation> invocations;
1101

1102
            private RunBuilder() {
1103
                // make default ctor private; use factory method Run#builder() instead.
1104
            }
1105

1106
            /**
1107
             * Information about the tool or tool pipeline that generated the results in this run. A run can only contain
1108
             * results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long
1109
             * as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files.
1110
             *
1111
             * @return {@code this}.
1112
             */
1113
            public SarifLog.Run.RunBuilder tool(final Tool tool) {
1114
                this.tool = tool;
1✔
1115
                return this;
1✔
1116
            }
1117

1118
            /**
1119
             * Adds a result to the set of results contained in an SARIF log. The results array can be omitted when
1120
             * a run is solely exporting rules metadata. It must be present (but may be empty) if a log file
1121
             * represents an actual scan.
1122
             *
1123
             * @return {@code this}.
1124
             */
1125
            public SarifLog.Run.RunBuilder result(final Result result) {
1126
                if (this.results == null) {
×
NEW
1127
                    this.results = new ArrayList<>();
×
1128
                }
1129
                this.results.add(result);
×
1130
                return this;
×
1131
            }
1132

1133
            /**
1134
             * The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting
1135
             * rules metadata. It must be present (but may be empty) if a log file represents an actual scan.
1136
             *
1137
             * @return {@code this}.
1138
             */
1139
            public SarifLog.Run.RunBuilder results(final Collection<? extends Result> results) {
1140
                if (results == null) {
1!
1141
                    throw new java.lang.NullPointerException("results cannot be null");
×
1142
                }
1143
                if (this.results == null) {
1!
1144
                    this.results = new ArrayList<>();
1✔
1145
                }
1146
                this.results.addAll(results);
1✔
1147
                return this;
1✔
1148
            }
1149

1150
            public SarifLog.Run.RunBuilder clearResults() {
UNCOV
1151
                if (this.results != null) {
×
1152
                    this.results.clear();
×
1153
                }
1154
                return this;
×
1155
            }
1156

1157
            /**
1158
             * The set of invocations providing information about the tool execution such as configuration errors or runtime
1159
             * exceptions.
1160
             *
1161
             * @return {@code this}.
1162
             */
1163
            public SarifLog.Run.RunBuilder invocations(final List<Invocation> invocations) {
1164
                this.invocations = invocations;
1✔
1165
                return this;
1✔
1166
            }
1167

1168
            public SarifLog.Run build() {
1169
                List<Result> results;
1170
                switch (this.results == null ? 0 : this.results.size()) {
1!
1171
                case 0:
1172
                    results = Collections.emptyList();
1✔
1173
                    break;
1✔
1174
                case 1:
1175
                    results = Collections.singletonList(this.results.get(0));
1✔
1176
                    break;
1✔
1177
                default:
1178
                    results = Collections.unmodifiableList(new ArrayList<>(this.results));
1✔
1179
                }
1180
                return new SarifLog.Run(this.tool, results, this.invocations);
1✔
1181
            }
1182

1183
            @Override
1184
            public String toString() {
UNCOV
1185
                return "SarifLog.Run.RunBuilder(tool=" + this.tool + ", results=" + this.results + ", invocations=" + this.invocations + ")";
×
1186
            }
1187
        }
1188

1189
        public static SarifLog.Run.RunBuilder builder() {
1190
            return new SarifLog.Run.RunBuilder();
1✔
1191
        }
1192

1193
        /**
1194
         * Information about the tool or tool pipeline that generated the results in this run. A run can only contain
1195
         * results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long
1196
         * as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files.
1197
         */
1198
        public Tool getTool() {
UNCOV
1199
            return this.tool;
×
1200
        }
1201

1202
        /**
1203
         * The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting
1204
         * rules metadata. It must be present (but may be empty) if a log file represents an actual scan.
1205
         */
1206
        public List<Result> getResults() {
UNCOV
1207
            return this.results;
×
1208
        }
1209

1210
        /**
1211
         * The set of invocations providing information about the tool execution such as configuration errors or runtime
1212
         * exceptions.
1213
         */
1214
        public List<Invocation> getInvocations() {
UNCOV
1215
            return this.invocations;
×
1216
        }
1217

1218
        /**
1219
         * Information about the tool or tool pipeline that generated the results in this run. A run can only contain
1220
         * results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long
1221
         * as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files.
1222
         *
1223
         * @return {@code this}.
1224
         */
1225
        public SarifLog.Run setTool(final Tool tool) {
UNCOV
1226
            this.tool = tool;
×
1227
            return this;
×
1228
        }
1229

1230
        /**
1231
         * The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting
1232
         * rules metadata. It must be present (but may be empty) if a log file represents an actual scan.
1233
         *
1234
         * @return {@code this}.
1235
         */
1236
        public SarifLog.Run setResults(final List<Result> results) {
UNCOV
1237
            this.results = results;
×
1238
            return this;
×
1239
        }
1240

1241
        /**
1242
         * The set of invocations providing information about the tool execution such as configuration errors or runtime
1243
         * exceptions.
1244
         *
1245
         * @return {@code this}.
1246
         */
1247
        public SarifLog.Run setInvocations(final List<Invocation> invocations) {
UNCOV
1248
            this.invocations = invocations;
×
1249
            return this;
×
1250
        }
1251

1252
        @Override
1253
        public boolean equals(Object o) {
NEW
1254
            if (o == null || getClass() != o.getClass()) {
×
UNCOV
1255
                return false;
×
1256
            }
NEW
1257
            Run run = (Run) o;
×
NEW
1258
            return Objects.equals(tool, run.tool) && Objects.equals(results, run.results) && Objects.equals(invocations, run.invocations);
×
1259
        }
1260

1261
        @Override
1262
        public int hashCode() {
NEW
1263
            return Objects.hash(tool, results, invocations);
×
1264
        }
1265

1266
        @Override
1267
        public String toString() {
UNCOV
1268
            return "SarifLog.Run(tool=" + this.getTool() + ", results=" + this.getResults() + ", invocations=" + this.getInvocations() + ")";
×
1269
        }
1270
    }
1271

1272

1273
    /**
1274
     * The analysis tool that was run.
1275
     */
1276
    public static final class Tool {
1277
        private Component driver;
1278

1279
        private Tool(final Component driver) {
1✔
1280
            this.driver = driver;
1✔
1281
        }
1✔
1282

1283

1284
        public static final class ToolBuilder {
1285
            private Component driver;
1286

1287
            private ToolBuilder() {
1288
                // make default ctor private; use factory method Tool#builder() instead.
1289
            }
1290

1291
            /**
1292
             * The analysis tool that was run.
1293
             *
1294
             * @return {@code this}.
1295
             */
1296
            public SarifLog.Tool.ToolBuilder driver(final Component driver) {
1297
                this.driver = driver;
1✔
1298
                return this;
1✔
1299
            }
1300

1301
            public SarifLog.Tool build() {
1302
                return new SarifLog.Tool(this.driver);
1✔
1303
            }
1304

1305
            @Override
1306
            public String toString() {
UNCOV
1307
                return "SarifLog.Tool.ToolBuilder(driver=" + this.driver + ")";
×
1308
            }
1309
        }
1310

1311
        public static SarifLog.Tool.ToolBuilder builder() {
1312
            return new SarifLog.Tool.ToolBuilder();
1✔
1313
        }
1314

1315
        /**
1316
         * The analysis tool that was run.
1317
         */
1318
        public Component getDriver() {
UNCOV
1319
            return this.driver;
×
1320
        }
1321

1322
        /**
1323
         * The analysis tool that was run.
1324
         *
1325
         * @return {@code this}.
1326
         */
1327
        public SarifLog.Tool setDriver(final Component driver) {
UNCOV
1328
            this.driver = driver;
×
1329
            return this;
×
1330
        }
1331

1332
        @Override
1333
        public boolean equals(Object o) {
NEW
1334
            if (o == null || getClass() != o.getClass()) {
×
UNCOV
1335
                return false;
×
1336
            }
NEW
1337
            Tool tool = (Tool) o;
×
NEW
1338
            return Objects.equals(driver, tool.driver);
×
1339
        }
1340

1341
        @Override
1342
        public int hashCode() {
NEW
1343
            return Objects.hashCode(driver);
×
1344
        }
1345

1346
        @Override
1347
        public String toString() {
UNCOV
1348
            return "SarifLog.Tool(driver=" + this.getDriver() + ")";
×
1349
        }
1350
    }
1351

1352

1353
    /**
1354
     * A component, such as a plug-in or the driver, of the analysis tool that was run.
1355
     */
1356
    public static final class Component {
1357
        private String name;
1358
        private String version;
1359
        private String informationUri;
1360
        private List<ReportingDescriptor> rules;
1361

1362
        private Component(final String name, final String version, final String informationUri, final List<ReportingDescriptor> rules) {
1✔
1363
            this.name = name;
1✔
1364
            this.version = version;
1✔
1365
            this.informationUri = informationUri;
1✔
1366
            this.rules = rules;
1✔
1367
        }
1✔
1368

1369
        public static final class ComponentBuilder {
1370
            private String name;
1371
            private String version;
1372
            private String informationUri;
1373
            private List<ReportingDescriptor> rules;
1374

1375
            private ComponentBuilder() {
1376
                // make default ctor private; use factory method Component#builder() instead.
1377
            }
1378

1379
            /**
1380
             * The name of the tool component.
1381
             *
1382
             * @return {@code this}.
1383
             */
1384
            public SarifLog.Component.ComponentBuilder name(final String name) {
1385
                this.name = name;
1✔
1386
                return this;
1✔
1387
            }
1388

1389
            /**
1390
             * The tool component version, in whatever format the component natively provides.
1391
             *
1392
             * @return {@code this}.
1393
             */
1394
            public SarifLog.Component.ComponentBuilder version(final String version) {
1395
                this.version = version;
1✔
1396
                return this;
1✔
1397
            }
1398

1399
            /**
1400
             * The absolute URI at which information about this version of the tool component can be found.
1401
             *
1402
             * @return {@code this}.
1403
             */
1404
            public SarifLog.Component.ComponentBuilder informationUri(final String informationUri) {
1405
                this.informationUri = informationUri;
1✔
1406
                return this;
1✔
1407
            }
1408

1409
            /**
1410
             * An array of reportingDescriptor objects relevant to the analysis performed by the tool component.
1411
             *
1412
             * @return {@code this}.
1413
             */
1414
            public SarifLog.Component.ComponentBuilder rules(final List<ReportingDescriptor> rules) {
1415
                this.rules = rules;
1✔
1416
                return this;
1✔
1417
            }
1418

1419
            public SarifLog.Component build() {
1420
                return new SarifLog.Component(this.name, this.version, this.informationUri, this.rules);
1✔
1421
            }
1422

1423
            @Override
1424
            public String toString() {
UNCOV
1425
                return "SarifLog.Component.ComponentBuilder(name=" + this.name + ", version=" + this.version + ", informationUri=" + this.informationUri + ", rules=" + this.rules + ")";
×
1426
            }
1427
        }
1428

1429
        public static SarifLog.Component.ComponentBuilder builder() {
1430
            return new SarifLog.Component.ComponentBuilder();
1✔
1431
        }
1432

1433
        public SarifLog.Component.ComponentBuilder toBuilder() {
1434
            return new SarifLog.Component.ComponentBuilder().name(this.name).version(this.version).informationUri(this.informationUri).rules(this.rules);
1✔
1435
        }
1436

1437
        /**
1438
         * The name of the tool component.
1439
         */
1440
        public String getName() {
UNCOV
1441
            return this.name;
×
1442
        }
1443

1444
        /**
1445
         * The tool component version, in whatever format the component natively provides.
1446
         */
1447
        public String getVersion() {
UNCOV
1448
            return this.version;
×
1449
        }
1450

1451
        /**
1452
         * The absolute URI at which information about this version of the tool component can be found.
1453
         */
1454
        public String getInformationUri() {
UNCOV
1455
            return this.informationUri;
×
1456
        }
1457

1458
        /**
1459
         * An array of reportingDescriptor objects relevant to the analysis performed by the tool component.
1460
         */
1461
        public List<ReportingDescriptor> getRules() {
UNCOV
1462
            return this.rules;
×
1463
        }
1464

1465
        /**
1466
         * The name of the tool component.
1467
         *
1468
         * @return {@code this}.
1469
         */
1470
        public SarifLog.Component setName(final String name) {
UNCOV
1471
            this.name = name;
×
1472
            return this;
×
1473
        }
1474

1475
        /**
1476
         * The tool component version, in whatever format the component natively provides.
1477
         *
1478
         * @return {@code this}.
1479
         */
1480
        public SarifLog.Component setVersion(final String version) {
UNCOV
1481
            this.version = version;
×
1482
            return this;
×
1483
        }
1484

1485
        /**
1486
         * The absolute URI at which information about this version of the tool component can be found.
1487
         *
1488
         * @return {@code this}.
1489
         */
1490
        public SarifLog.Component setInformationUri(final String informationUri) {
UNCOV
1491
            this.informationUri = informationUri;
×
1492
            return this;
×
1493
        }
1494

1495
        /**
1496
         * An array of reportingDescriptor objects relevant to the analysis performed by the tool component.
1497
         *
1498
         * @return {@code this}.
1499
         */
1500
        public SarifLog.Component setRules(final List<ReportingDescriptor> rules) {
UNCOV
1501
            this.rules = rules;
×
1502
            return this;
×
1503
        }
1504

1505
        @Override
1506
        public boolean equals(Object o) {
NEW
1507
            if (o == null || getClass() != o.getClass()) {
×
UNCOV
1508
                return false;
×
1509
            }
NEW
1510
            Component component = (Component) o;
×
NEW
1511
            return Objects.equals(name, component.name) && Objects.equals(version, component.version) && Objects.equals(informationUri, component.informationUri) && Objects.equals(rules, component.rules);
×
1512
        }
1513

1514
        @Override
1515
        public int hashCode() {
NEW
1516
            return Objects.hash(name, version, informationUri, rules);
×
1517
        }
1518

1519
        @Override
1520
        public String toString() {
UNCOV
1521
            return "SarifLog.Component(name=" + this.getName() + ", version=" + this.getVersion() + ", informationUri=" + this.getInformationUri() + ", rules=" + this.getRules() + ")";
×
1522
        }
1523
    }
1524

1525

1526
    /**
1527
     * Metadata that describes a specific report produced by the tool, as part of the analysis it provides or its runtime
1528
     * reporting.
1529
     */
1530
    public static final class ReportingDescriptor {
1531
        private String id;
1532
        private String name;
1533
        private MultiformatMessage shortDescription;
1534
        private MultiformatMessage fullDescription;
1535
        private MultiformatMessage messageStrings;
1536
        private String helpUri;
1537
        private MultiformatMessage help;
1538
        private PropertyBag properties;
1539
        private ReportingConfiguration defaultConfiguration;
1540

1541
        private ReportingDescriptor(final String id, final String name, final MultiformatMessage shortDescription, final MultiformatMessage fullDescription, final MultiformatMessage messageStrings, final String helpUri, final MultiformatMessage help, final PropertyBag properties, final ReportingConfiguration defaultConfiguration) {
1✔
1542
            this.id = id;
1✔
1543
            this.name = name;
1✔
1544
            this.shortDescription = shortDescription;
1✔
1545
            this.fullDescription = fullDescription;
1✔
1546
            this.messageStrings = messageStrings;
1✔
1547
            this.helpUri = helpUri;
1✔
1548
            this.help = help;
1✔
1549
            this.properties = properties;
1✔
1550
            this.defaultConfiguration = defaultConfiguration;
1✔
1551
        }
1✔
1552

1553

1554
        public static final class ReportingDescriptorBuilder {
1555
            private String id;
1556
            private String name;
1557
            private MultiformatMessage shortDescription;
1558
            private MultiformatMessage fullDescription;
1559
            private MultiformatMessage messageStrings;
1560
            private String helpUri;
1561
            private MultiformatMessage help;
1562
            private PropertyBag properties;
1563
            private ReportingConfiguration defaultConfiguration;
1564

1565
            private ReportingDescriptorBuilder() {
1566
                // make default ctor private; use factory method ReportingDescriptor#builder() instead.
1567
            }
1568

1569
            /**
1570
             * A stable, opaque identifier for the report.
1571
             *
1572
             * @return {@code this}.
1573
             */
1574
            public SarifLog.ReportingDescriptor.ReportingDescriptorBuilder id(final String id) {
1575
                this.id = id;
1✔
1576
                return this;
1✔
1577
            }
1578

1579
            /**
1580
             * A report identifier that is understandable to an end user.
1581
             *
1582
             * @return {@code this}.
1583
             */
1584
            public SarifLog.ReportingDescriptor.ReportingDescriptorBuilder name(final String name) {
UNCOV
1585
                this.name = name;
×
1586
                return this;
×
1587
            }
1588

1589
            /**
1590
             * A concise description of the report. Should be a single sentence that is understandable when visible space is
1591
             * limited to a single line of text.
1592
             *
1593
             * @return {@code this}.
1594
             */
1595
            public SarifLog.ReportingDescriptor.ReportingDescriptorBuilder shortDescription(final MultiformatMessage shortDescription) {
1596
                this.shortDescription = shortDescription;
1✔
1597
                return this;
1✔
1598
            }
1599

1600
            /**
1601
             * A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any
1602
             * problem indicated by the result.
1603
             *
1604
             * @return {@code this}.
1605
             */
1606
            public SarifLog.ReportingDescriptor.ReportingDescriptorBuilder fullDescription(final MultiformatMessage fullDescription) {
1607
                this.fullDescription = fullDescription;
1✔
1608
                return this;
1✔
1609
            }
1610

1611
            /**
1612
             * A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds
1613
             * message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can
1614
             * be used to construct a message in combination with an arbitrary number of additional string arguments.
1615
             *
1616
             * @return {@code this}.
1617
             */
1618
            public SarifLog.ReportingDescriptor.ReportingDescriptorBuilder messageStrings(final MultiformatMessage messageStrings) {
UNCOV
1619
                this.messageStrings = messageStrings;
×
1620
                return this;
×
1621
            }
1622

1623
            /**
1624
             * A URI where the primary documentation for the report can be found.
1625
             *
1626
             * @return {@code this}.
1627
             */
1628
            public SarifLog.ReportingDescriptor.ReportingDescriptorBuilder helpUri(final String helpUri) {
1629
                this.helpUri = helpUri;
1✔
1630
                return this;
1✔
1631
            }
1632

1633
            /**
1634
             * Provides the primary documentation for the report, useful when there is no online documentation.
1635
             *
1636
             * @return {@code this}.
1637
             */
1638
            public SarifLog.ReportingDescriptor.ReportingDescriptorBuilder help(final MultiformatMessage help) {
1639
                this.help = help;
1✔
1640
                return this;
1✔
1641
            }
1642

1643
            /**
1644
             * Key/value pairs that provide additional information about the report.
1645
             *
1646
             * @return {@code this}.
1647
             */
1648
            public SarifLog.ReportingDescriptor.ReportingDescriptorBuilder properties(final PropertyBag properties) {
1649
                this.properties = properties;
1✔
1650
                return this;
1✔
1651
            }
1652

1653
            /**
1654
             * The default configuration of a rule, can contain a default level and other properties.
1655
             *
1656
             * @return {@code this}.
1657
             */
1658
            public SarifLog.ReportingDescriptor.ReportingDescriptorBuilder defaultConfiguration(final ReportingConfiguration defaultConfiguration) {
1659
                this.defaultConfiguration = defaultConfiguration;
1✔
1660
                return this;
1✔
1661
            }
1662

1663
            public SarifLog.ReportingDescriptor build() {
1664
                return new SarifLog.ReportingDescriptor(this.id, this.name, this.shortDescription, this.fullDescription, this.messageStrings, this.helpUri, this.help, this.properties, this.defaultConfiguration);
1✔
1665
            }
1666

1667
            @Override
1668
            public String toString() {
UNCOV
1669
                return "SarifLog.ReportingDescriptor.ReportingDescriptorBuilder(id=" + this.id + ", name=" + this.name + ", shortDescription=" + this.shortDescription + ", fullDescription=" + this.fullDescription + ", messageStrings=" + this.messageStrings + ", helpUri=" + this.helpUri + ", help=" + this.help + ", properties=" + this.properties + ", defaultConfiguration=" + this.defaultConfiguration + ")";
×
1670
            }
1671
        }
1672

1673
        public static SarifLog.ReportingDescriptor.ReportingDescriptorBuilder builder() {
1674
            return new SarifLog.ReportingDescriptor.ReportingDescriptorBuilder();
1✔
1675
        }
1676

1677
        /**
1678
         * A stable, opaque identifier for the report.
1679
         */
1680
        public String getId() {
1681
            return this.id;
1✔
1682
        }
1683

1684
        /**
1685
         * A report identifier that is understandable to an end user.
1686
         */
1687
        public String getName() {
UNCOV
1688
            return this.name;
×
1689
        }
1690

1691
        /**
1692
         * A concise description of the report. Should be a single sentence that is understandable when visible space is
1693
         * limited to a single line of text.
1694
         */
1695
        public MultiformatMessage getShortDescription() {
1696
            return this.shortDescription;
1✔
1697
        }
1698

1699
        /**
1700
         * A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any
1701
         * problem indicated by the result.
1702
         */
1703
        public MultiformatMessage getFullDescription() {
UNCOV
1704
            return this.fullDescription;
×
1705
        }
1706

1707
        /**
1708
         * A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds
1709
         * message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can
1710
         * be used to construct a message in combination with an arbitrary number of additional string arguments.
1711
         */
1712
        public MultiformatMessage getMessageStrings() {
UNCOV
1713
            return this.messageStrings;
×
1714
        }
1715

1716
        /**
1717
         * A URI where the primary documentation for the report can be found.
1718
         */
1719
        public String getHelpUri() {
UNCOV
1720
            return this.helpUri;
×
1721
        }
1722

1723
        /**
1724
         * Provides the primary documentation for the report, useful when there is no online documentation.
1725
         */
1726
        public MultiformatMessage getHelp() {
UNCOV
1727
            return this.help;
×
1728
        }
1729

1730
        /**
1731
         * Key/value pairs that provide additional information about the report.
1732
         */
1733
        public PropertyBag getProperties() {
UNCOV
1734
            return this.properties;
×
1735
        }
1736

1737
        /**
1738
         * The default configuration of a rule, can contain a default level and other properties.
1739
         */
1740
        public ReportingConfiguration getDefaultConfiguration() {
UNCOV
1741
            return this.defaultConfiguration;
×
1742
        }
1743

1744
        /**
1745
         * A stable, opaque identifier for the report.
1746
         *
1747
         * @return {@code this}.
1748
         */
1749
        public SarifLog.ReportingDescriptor setId(final String id) {
UNCOV
1750
            this.id = id;
×
1751
            return this;
×
1752
        }
1753

1754
        /**
1755
         * A report identifier that is understandable to an end user.
1756
         *
1757
         * @return {@code this}.
1758
         */
1759
        public SarifLog.ReportingDescriptor setName(final String name) {
UNCOV
1760
            this.name = name;
×
1761
            return this;
×
1762
        }
1763

1764
        /**
1765
         * A concise description of the report. Should be a single sentence that is understandable when visible space is
1766
         * limited to a single line of text.
1767
         *
1768
         * @return {@code this}.
1769
         */
1770
        public SarifLog.ReportingDescriptor setShortDescription(final MultiformatMessage shortDescription) {
UNCOV
1771
            this.shortDescription = shortDescription;
×
1772
            return this;
×
1773
        }
1774

1775
        /**
1776
         * A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any
1777
         * problem indicated by the result.
1778
         *
1779
         * @return {@code this}.
1780
         */
1781
        public SarifLog.ReportingDescriptor setFullDescription(final MultiformatMessage fullDescription) {
UNCOV
1782
            this.fullDescription = fullDescription;
×
1783
            return this;
×
1784
        }
1785

1786
        /**
1787
         * A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds
1788
         * message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can
1789
         * be used to construct a message in combination with an arbitrary number of additional string arguments.
1790
         *
1791
         * @return {@code this}.
1792
         */
1793
        public SarifLog.ReportingDescriptor setMessageStrings(final MultiformatMessage messageStrings) {
UNCOV
1794
            this.messageStrings = messageStrings;
×
1795
            return this;
×
1796
        }
1797

1798
        /**
1799
         * A URI where the primary documentation for the report can be found.
1800
         *
1801
         * @return {@code this}.
1802
         */
1803
        public SarifLog.ReportingDescriptor setHelpUri(final String helpUri) {
UNCOV
1804
            this.helpUri = helpUri;
×
1805
            return this;
×
1806
        }
1807

1808
        /**
1809
         * Provides the primary documentation for the report, useful when there is no online documentation.
1810
         *
1811
         * @return {@code this}.
1812
         */
1813
        public SarifLog.ReportingDescriptor setHelp(final MultiformatMessage help) {
UNCOV
1814
            this.help = help;
×
1815
            return this;
×
1816
        }
1817

1818
        /**
1819
         * Key/value pairs that provide additional information about the report.
1820
         *
1821
         * @return {@code this}.
1822
         */
1823
        public SarifLog.ReportingDescriptor setProperties(final PropertyBag properties) {
UNCOV
1824
            this.properties = properties;
×
1825
            return this;
×
1826
        }
1827

1828
        /**
1829
         * The default configuration of a rule, can contain a default level and other properties.
1830
         *
1831
         * @return {@code this}.
1832
         */
1833
        public SarifLog.ReportingDescriptor setDefaultConfiguration(final ReportingConfiguration defaultConfiguration) {
UNCOV
1834
            this.defaultConfiguration = defaultConfiguration;
×
1835
            return this;
×
1836
        }
1837

1838
        @Override
1839
        public boolean equals(Object o) {
1840
            if (o == null || getClass() != o.getClass()) {
1!
UNCOV
1841
                return false;
×
1842
            }
1843
            ReportingDescriptor that = (ReportingDescriptor) o;
1✔
1844
            return Objects.equals(id, that.id) && Objects.equals(name, that.name) && Objects.equals(shortDescription, that.shortDescription) && Objects.equals(fullDescription, that.fullDescription) && Objects.equals(messageStrings, that.messageStrings) && Objects.equals(helpUri, that.helpUri) && Objects.equals(help, that.help) && Objects.equals(properties, that.properties) && Objects.equals(defaultConfiguration, that.defaultConfiguration);
1!
1845
        }
1846

1847
        @Override
1848
        public int hashCode() {
NEW
1849
            return Objects.hash(id, name, shortDescription, fullDescription, messageStrings, helpUri, help, properties, defaultConfiguration);
×
1850
        }
1851

1852
        @Override
1853
        public String toString() {
UNCOV
1854
            return "SarifLog.ReportingDescriptor(id=" + this.getId() + ", name=" + this.getName() + ", shortDescription=" + this.getShortDescription() + ", fullDescription=" + this.getFullDescription() + ", messageStrings=" + this.getMessageStrings() + ", helpUri=" + this.getHelpUri() + ", help=" + this.getHelp() + ", properties=" + this.getProperties() + ", defaultConfiguration=" + this.getDefaultConfiguration() + ")";
×
1855
        }
1856
    }
1857

1858

1859
    /**
1860
     * Configure the Sarif reporting defined by a reportingDescriptor.
1861
     * Can be used as the defaultConfiguration of a reportingDescriptor.
1862
     * Can also be used in configurationOverride to override those defaults.
1863
     */
1864
    public static final class ReportingConfiguration {
1865
        private Boolean enabled;
1866
        private String level;
1867
        private Double rank;
1868
        private PropertyBag parameters;
1869

1870
        private ReportingConfiguration(final Boolean enabled, final String level, final Double rank, final PropertyBag parameters) {
1✔
1871
            this.enabled = enabled;
1✔
1872
            this.level = level;
1✔
1873
            this.rank = rank;
1✔
1874
            this.parameters = parameters;
1✔
1875
        }
1✔
1876

1877
        public static final class ReportingConfigurationBuilder {
1878
            private Boolean enabled;
1879
            private String level;
1880
            private Double rank;
1881
            private PropertyBag parameters;
1882

1883
            private ReportingConfigurationBuilder() {
1884
                // make default ctor private; use factory method ReportingConfiguration#builder() instead.
1885
            }
1886

1887
            /**
1888
             * Boolean, to dis- and enable the config based on matching a rule (through the Descriptor).
1889
             *
1890
             * <p>Default: true
1891
             */
1892
            public SarifLog.ReportingConfiguration.ReportingConfigurationBuilder enabled(final Boolean enabled) {
UNCOV
1893
                this.enabled = enabled;
×
1894
                return this;
×
1895
            }
1896

1897
            /**
1898
             * Takes the levelProperty of the Descriptor (if present) or provides a default/override.
1899
             *
1900
             * <p>Default: warning
1901
             */
1902
            public SarifLog.ReportingConfiguration.ReportingConfigurationBuilder level(final String level) {
1903
                this.level = level;
1✔
1904
                return this;
1✔
1905
            }
1906

1907
            /**
1908
             * Takes the rank/priority of the Descriptor (if present) or provides a default/override value between 1.0 and 100.0.
1909
             *
1910
             * <p>Default: -1.0
1911
             */
1912
            public SarifLog.ReportingConfiguration.ReportingConfigurationBuilder rank(final Double rank) {
UNCOV
1913
                this.rank = rank;
×
1914
                return this;
×
1915
            }
1916

1917
            /**
1918
             * Define configuration information (propertyBag) specific to the Descriptor.
1919
             */
1920
            public SarifLog.ReportingConfiguration.ReportingConfigurationBuilder parameters(final PropertyBag parameters) {
UNCOV
1921
                this.parameters = parameters;
×
1922
                return this;
×
1923
            }
1924

1925
            public SarifLog.ReportingConfiguration build() {
1926
                return new SarifLog.ReportingConfiguration(this.enabled, this.level, this.rank, this.parameters);
1✔
1927
            }
1928

1929
            @Override
1930
            public String toString() {
UNCOV
1931
                return "SarifLog.ReportingConfiguration.ReportingConfigurationBuilder(enabled=" + this.enabled + ", level=" + this.level + ", rank=" + this.rank + ", parameters=" + this.parameters + ")";
×
1932
            }
1933
        }
1934

1935
        public static SarifLog.ReportingConfiguration.ReportingConfigurationBuilder builder() {
1936
            return new SarifLog.ReportingConfiguration.ReportingConfigurationBuilder();
1✔
1937
        }
1938

1939
        /**
1940
         * Boolean, to dis- and enable the config based on matching a rule (through the Descriptor).
1941
         */
1942
        public Boolean getEnabled() {
UNCOV
1943
            return this.enabled;
×
1944
        }
1945

1946
        /**
1947
         * Takes the levelProperty of the Descriptor (if present) or provides a default/override.
1948
         */
1949
        public String getLevel() {
UNCOV
1950
            return this.level;
×
1951
        }
1952

1953
        /**
1954
         * Takes the rank/priority of the Descriptor (if present) or provides a default/override value between 1.0 and 100.0.
1955
         */
1956
        public Double getRank() {
UNCOV
1957
            return this.rank;
×
1958
        }
1959

1960
        /**
1961
         * Define configuration information (propertyBag) specific to the Descriptor.
1962
         */
1963
        public PropertyBag getParameters() {
UNCOV
1964
            return this.parameters;
×
1965
        }
1966

1967
        /**
1968
         * Boolean, to dis- and enable the config based on matching a rule (through the Descriptor).
1969
         *
1970
         * @return {@code this}.
1971
         */
1972
        public SarifLog.ReportingConfiguration setEnabled(final Boolean enabled) {
UNCOV
1973
            this.enabled = enabled;
×
1974
            return this;
×
1975
        }
1976

1977
        /**
1978
         * Takes the levelProperty of the Descriptor (if present) or provides a default/override.
1979
         *
1980
         * @return {@code this}.
1981
         */
1982
        public SarifLog.ReportingConfiguration setLevel(final String level) {
UNCOV
1983
            this.level = level;
×
1984
            return this;
×
1985
        }
1986

1987
        /**
1988
         * Takes the rank/priority of the Descriptor (if present) or provides a default/override value between 1.0 and 100.0.
1989
         *
1990
         * @return {@code this}.
1991
         */
1992
        public SarifLog.ReportingConfiguration setRank(final Double rank) {
UNCOV
1993
            this.rank = rank;
×
1994
            return this;
×
1995
        }
1996

1997
        /**
1998
         * Define configuration information (propertyBag) specific to the Descriptor.
1999
         *
2000
         * @return {@code this}.
2001
         */
2002
        public SarifLog.ReportingConfiguration setParameters(final PropertyBag parameters) {
UNCOV
2003
            this.parameters = parameters;
×
2004
            return this;
×
2005
        }
2006

2007
        @Override
2008
        public boolean equals(Object o) {
2009
            if (o == null || getClass() != o.getClass()) {
1!
UNCOV
2010
                return false;
×
2011
            }
2012
            ReportingConfiguration that = (ReportingConfiguration) o;
1✔
2013
            return Objects.equals(enabled, that.enabled) && Objects.equals(level, that.level) && Objects.equals(rank, that.rank) && Objects.equals(parameters, that.parameters);
1!
2014
        }
2015

2016
        @Override
2017
        public int hashCode() {
NEW
2018
            return Objects.hash(enabled, level, rank, parameters);
×
2019
        }
2020

2021
        @Override
2022
        public String toString() {
UNCOV
2023
            return "SarifLog.ReportingConfiguration(enabled=" + this.getEnabled() + ", level=" + this.getLevel() + ", rank=" + this.getRank() + ", parameters=" + this.getParameters() + ")";
×
2024
        }
2025
    }
2026

2027

2028
    /**
2029
     * A message string or message format string rendered in multiple formats.
2030
     */
2031
    public static final class MultiformatMessage {
2032
        private String text;
2033
        private String markdown;
2034

2035
        public MultiformatMessage(String text) {
1✔
2036
            this.text = text;
1✔
2037
        }
1✔
2038

NEW
2039
        public MultiformatMessage(final String text, final String markdown) {
×
NEW
2040
            this.text = text;
×
NEW
2041
            this.markdown = markdown;
×
NEW
2042
        }
×
2043

2044
        public static final class MultiformatMessageBuilder {
2045
            private String text;
2046
            private String markdown;
2047

2048
            private MultiformatMessageBuilder() {
2049
                // make default ctor private; use factory method MultiformatMessage#builder() instead.
2050
            }
2051

2052
            /**
2053
             * A plain text message string or format string.
2054
             *
2055
             * @return {@code this}.
2056
             */
2057
            public SarifLog.MultiformatMessage.MultiformatMessageBuilder text(final String text) {
UNCOV
2058
                this.text = text;
×
2059
                return this;
×
2060
            }
2061

2062
            /**
2063
             * A Markdown message string or format string.
2064
             *
2065
             * @return {@code this}.
2066
             */
2067
            public SarifLog.MultiformatMessage.MultiformatMessageBuilder markdown(final String markdown) {
UNCOV
2068
                this.markdown = markdown;
×
2069
                return this;
×
2070
            }
2071

2072
            public SarifLog.MultiformatMessage build() {
UNCOV
2073
                return new SarifLog.MultiformatMessage(this.text, this.markdown);
×
2074
            }
2075

2076
            @Override
2077
            public String toString() {
UNCOV
2078
                return "SarifLog.MultiformatMessage.MultiformatMessageBuilder(text=" + this.text + ", markdown=" + this.markdown + ")";
×
2079
            }
2080
        }
2081

2082
        public static SarifLog.MultiformatMessage.MultiformatMessageBuilder builder() {
UNCOV
2083
            return new SarifLog.MultiformatMessage.MultiformatMessageBuilder();
×
2084
        }
2085

2086
        /**
2087
         * A plain text message string or format string.
2088
         */
2089
        public String getText() {
2090
            return this.text;
1✔
2091
        }
2092

2093
        /**
2094
         * A Markdown message string or format string.
2095
         */
2096
        public String getMarkdown() {
UNCOV
2097
            return this.markdown;
×
2098
        }
2099

2100
        /**
2101
         * A plain text message string or format string.
2102
         *
2103
         * @return {@code this}.
2104
         */
2105
        public SarifLog.MultiformatMessage setText(final String text) {
UNCOV
2106
            this.text = text;
×
2107
            return this;
×
2108
        }
2109

2110
        /**
2111
         * A Markdown message string or format string.
2112
         *
2113
         * @return {@code this}.
2114
         */
2115
        public SarifLog.MultiformatMessage setMarkdown(final String markdown) {
UNCOV
2116
            this.markdown = markdown;
×
2117
            return this;
×
2118
        }
2119

2120
        @Override
2121
        public boolean equals(Object o) {
2122
            if (o == null || getClass() != o.getClass()) {
1!
UNCOV
2123
                return false;
×
2124
            }
2125
            MultiformatMessage that = (MultiformatMessage) o;
1✔
2126
            return Objects.equals(text, that.text) && Objects.equals(markdown, that.markdown);
1!
2127
        }
2128

2129
        @Override
2130
        public int hashCode() {
NEW
2131
            return Objects.hash(text, markdown);
×
2132
        }
2133

2134
        @Override
2135
        public String toString() {
NEW
2136
            return "SarifLog.MultiformatMessage(text=" + this.getText() + ", markdown=" + this.getMarkdown() + ")";
×
2137
        }
2138
    }
2139

2140

2141
    /**
2142
     * An exception information object, for the tool runtime errors.
2143
     */
2144
    public static final class Exception {
2145
        private String message;
2146

2147
        private Exception(final String message) {
1✔
2148
            this.message = message;
1✔
2149
        }
1✔
2150

2151
        public static final class ExceptionBuilder {
2152
            private String message;
2153

2154
            private ExceptionBuilder() {
2155
                // make default ctor private; use factory method Exception#builder() instead.
2156
            }
2157

2158
            /**
2159
             * A plain text message string or format string.
2160
             *
2161
             * @return {@code this}.
2162
             */
2163
            public SarifLog.Exception.ExceptionBuilder message(final String message) {
2164
                this.message = message;
1✔
2165
                return this;
1✔
2166
            }
2167

2168
            public SarifLog.Exception build() {
2169
                return new SarifLog.Exception(this.message);
1✔
2170
            }
2171

2172
            @Override
2173
            public String toString() {
UNCOV
2174
                return "SarifLog.Exception.ExceptionBuilder(message=" + this.message + ")";
×
2175
            }
2176
        }
2177

2178
        public static SarifLog.Exception.ExceptionBuilder builder() {
2179
            return new SarifLog.Exception.ExceptionBuilder();
1✔
2180
        }
2181

2182
        public SarifLog.Exception.ExceptionBuilder toBuilder() {
UNCOV
2183
            return new SarifLog.Exception.ExceptionBuilder().message(this.message);
×
2184
        }
2185

2186
        /**
2187
         * A plain text message string or format string.
2188
         */
2189
        public String getMessage() {
UNCOV
2190
            return this.message;
×
2191
        }
2192

2193
        /**
2194
         * A plain text message string or format string.
2195
         *
2196
         * @return {@code this}.
2197
         */
2198
        public SarifLog.Exception setMessage(final String message) {
UNCOV
2199
            this.message = message;
×
2200
            return this;
×
2201
        }
2202

2203
        @Override
2204
        public boolean equals(Object o) {
NEW
2205
            if (o == null || getClass() != o.getClass()) {
×
UNCOV
2206
                return false;
×
2207
            }
NEW
2208
            Exception exception = (Exception) o;
×
NEW
2209
            return Objects.equals(message, exception.message);
×
2210
        }
2211

2212
        @Override
2213
        public int hashCode() {
NEW
2214
            return Objects.hashCode(message);
×
2215
        }
2216

2217
        @Override
2218
        public String toString() {
UNCOV
2219
            return "SarifLog.Exception(message=" + this.getMessage() + ")";
×
2220
        }
2221
    }
2222

2223

2224
    /**
2225
     * An associated rule to the toolConfigurationNotification.
2226
     */
2227
    public static final class AssociatedRule {
2228
        private String id;
2229

2230
        private AssociatedRule(final String id) {
1✔
2231
            this.id = id;
1✔
2232
        }
1✔
2233

2234
        public static final class AssociatedRuleBuilder {
2235
            private String id;
2236

2237
            private AssociatedRuleBuilder() {
2238
                // make default ctor private; use factory method AssociatedRule#builder() instead.
2239
            }
2240

2241
            /**
2242
             * The stable, unique identifier of the rule, if any, to which this result is relevant.
2243
             *
2244
             * @return {@code this}.
2245
             */
2246
            public SarifLog.AssociatedRule.AssociatedRuleBuilder id(final String id) {
2247
                this.id = id;
1✔
2248
                return this;
1✔
2249
            }
2250

2251
            public SarifLog.AssociatedRule build() {
2252
                return new SarifLog.AssociatedRule(this.id);
1✔
2253
            }
2254

2255
            @Override
2256
            public String toString() {
UNCOV
2257
                return "SarifLog.AssociatedRule.AssociatedRuleBuilder(id=" + this.id + ")";
×
2258
            }
2259
        }
2260

2261
        public static SarifLog.AssociatedRule.AssociatedRuleBuilder builder() {
2262
            return new SarifLog.AssociatedRule.AssociatedRuleBuilder();
1✔
2263
        }
2264

2265
        public SarifLog.AssociatedRule.AssociatedRuleBuilder toBuilder() {
UNCOV
2266
            return new SarifLog.AssociatedRule.AssociatedRuleBuilder().id(this.id);
×
2267
        }
2268

2269
        /**
2270
         * The stable, unique identifier of the rule, if any, to which this result is relevant.
2271
         */
2272
        public String getId() {
UNCOV
2273
            return this.id;
×
2274
        }
2275

2276
        /**
2277
         * The stable, unique identifier of the rule, if any, to which this result is relevant.
2278
         *
2279
         * @return {@code this}.
2280
         */
2281
        public SarifLog.AssociatedRule setId(final String id) {
UNCOV
2282
            this.id = id;
×
2283
            return this;
×
2284
        }
2285

2286
        @Override
2287
        public boolean equals(Object o) {
NEW
2288
            if (o == null || getClass() != o.getClass()) {
×
UNCOV
2289
                return false;
×
2290
            }
NEW
2291
            AssociatedRule that = (AssociatedRule) o;
×
NEW
2292
            return Objects.equals(id, that.id);
×
2293
        }
2294

2295
        @Override
2296
        public int hashCode() {
NEW
2297
            return Objects.hashCode(id);
×
2298
        }
2299

2300
        @Override
2301
        public String toString() {
UNCOV
2302
            return "SarifLog.AssociatedRule(id=" + this.getId() + ")";
×
2303
        }
2304
    }
2305

2306

2307
    /**
2308
     * An invocation property to specify tool configuration errors.
2309
     */
2310
    public static final class ToolConfigurationNotification {
2311
        private AssociatedRule associatedRule;
2312
        private Message message;
2313

2314
        private ToolConfigurationNotification(final AssociatedRule associatedRule, final Message message) {
1✔
2315
            this.associatedRule = associatedRule;
1✔
2316
            this.message = message;
1✔
2317
        }
1✔
2318

2319
        public static final class ToolConfigurationNotificationBuilder {
2320
            private AssociatedRule associatedRule;
2321
            private Message message;
2322

2323
            private ToolConfigurationNotificationBuilder() {
2324
                // make default ctor private; use factory method ToolConfigurationNotification#builder() instead.
2325
            }
2326

2327
            /**
2328
             * An associated rule.
2329
             *
2330
             * @return {@code this}.
2331
             */
2332
            public SarifLog.ToolConfigurationNotification.ToolConfigurationNotificationBuilder associatedRule(final AssociatedRule associatedRule) {
2333
                this.associatedRule = associatedRule;
1✔
2334
                return this;
1✔
2335
            }
2336

2337
            /**
2338
             * A message component to detail the configuration error.
2339
             *
2340
             * @return {@code this}.
2341
             */
2342
            public SarifLog.ToolConfigurationNotification.ToolConfigurationNotificationBuilder message(final Message message) {
2343
                this.message = message;
1✔
2344
                return this;
1✔
2345
            }
2346

2347
            public SarifLog.ToolConfigurationNotification build() {
2348
                return new SarifLog.ToolConfigurationNotification(this.associatedRule, this.message);
1✔
2349
            }
2350

2351
            @Override
2352
            public String toString() {
UNCOV
2353
                return "SarifLog.ToolConfigurationNotification.ToolConfigurationNotificationBuilder(associatedRule=" + this.associatedRule + ", message=" + this.message + ")";
×
2354
            }
2355
        }
2356

2357
        public static SarifLog.ToolConfigurationNotification.ToolConfigurationNotificationBuilder builder() {
2358
            return new SarifLog.ToolConfigurationNotification.ToolConfigurationNotificationBuilder();
1✔
2359
        }
2360

2361
        public SarifLog.ToolConfigurationNotification.ToolConfigurationNotificationBuilder toBuilder() {
UNCOV
2362
            return new SarifLog.ToolConfigurationNotification.ToolConfigurationNotificationBuilder().associatedRule(this.associatedRule).message(this.message);
×
2363
        }
2364

2365
        /**
2366
         * An associated rule.
2367
         */
2368
        public AssociatedRule getAssociatedRule() {
UNCOV
2369
            return this.associatedRule;
×
2370
        }
2371

2372
        /**
2373
         * A message component to detail the configuration error.
2374
         */
2375
        public Message getMessage() {
UNCOV
2376
            return this.message;
×
2377
        }
2378

2379
        /**
2380
         * An associated rule.
2381
         *
2382
         * @return {@code this}.
2383
         */
2384
        public SarifLog.ToolConfigurationNotification setAssociatedRule(final AssociatedRule associatedRule) {
UNCOV
2385
            this.associatedRule = associatedRule;
×
2386
            return this;
×
2387
        }
2388

2389
        /**
2390
         * A message component to detail the configuration error.
2391
         *
2392
         * @return {@code this}.
2393
         */
2394
        public SarifLog.ToolConfigurationNotification setMessage(final Message message) {
UNCOV
2395
            this.message = message;
×
2396
            return this;
×
2397
        }
2398

2399
        @Override
2400
        public boolean equals(Object o) {
NEW
2401
            if (o == null || getClass() != o.getClass()) {
×
UNCOV
2402
                return false;
×
2403
            }
NEW
2404
            ToolConfigurationNotification that = (ToolConfigurationNotification) o;
×
NEW
2405
            return Objects.equals(associatedRule, that.associatedRule) && Objects.equals(message, that.message);
×
2406
        }
2407

2408
        @Override
2409
        public int hashCode() {
NEW
2410
            return Objects.hash(associatedRule, message);
×
2411
        }
2412

2413
        @Override
2414
        public String toString() {
UNCOV
2415
            return "SarifLog.ToolConfigurationNotification(associatedRule=" + this.getAssociatedRule() + ", message=" + this.getMessage() + ")";
×
2416
        }
2417
    }
2418

2419

2420
    /**
2421
     * An invocation property to specify tool runtime errors.
2422
     */
2423
    public static final class ToolExecutionNotification {
2424
        private List<Location> locations;
2425
        private Message message;
2426
        private Exception exception;
2427

2428
        private ToolExecutionNotification(final List<Location> locations, final Message message, final Exception exception) {
1✔
2429
            this.locations = locations;
1✔
2430
            this.message = message;
1✔
2431
            this.exception = exception;
1✔
2432
        }
1✔
2433

2434
        public static final class ToolExecutionNotificationBuilder {
2435
            private List<Location> locations;
2436
            private Message message;
2437
            private Exception exception;
2438

2439
            private ToolExecutionNotificationBuilder() {
2440
                // make default ctor private; use factory method ToolExecutionNotification#builder() instead.
2441
            }
2442

2443
            /**
2444
             * A list of related locations to the error.
2445
             *
2446
             * @return {@code this}.
2447
             */
2448
            public SarifLog.ToolExecutionNotification.ToolExecutionNotificationBuilder locations(final List<Location> locations) {
2449
                this.locations = locations;
1✔
2450
                return this;
1✔
2451
            }
2452

2453
            /**
2454
             * A message component to detail the runtime error.
2455
             *
2456
             * @return {@code this}.
2457
             */
2458
            public SarifLog.ToolExecutionNotification.ToolExecutionNotificationBuilder message(final Message message) {
2459
                this.message = message;
1✔
2460
                return this;
1✔
2461
            }
2462

2463
            /**
2464
             * A exception component to detail the tool exception.
2465
             *
2466
             * @return {@code this}.
2467
             */
2468
            public SarifLog.ToolExecutionNotification.ToolExecutionNotificationBuilder exception(final Exception exception) {
2469
                this.exception = exception;
1✔
2470
                return this;
1✔
2471
            }
2472

2473
            public SarifLog.ToolExecutionNotification build() {
2474
                return new SarifLog.ToolExecutionNotification(this.locations, this.message, this.exception);
1✔
2475
            }
2476

2477
            @Override
2478
            public String toString() {
UNCOV
2479
                return "SarifLog.ToolExecutionNotification.ToolExecutionNotificationBuilder(locations=" + this.locations + ", message=" + this.message + ", exception=" + this.exception + ")";
×
2480
            }
2481
        }
2482

2483
        public static SarifLog.ToolExecutionNotification.ToolExecutionNotificationBuilder builder() {
2484
            return new SarifLog.ToolExecutionNotification.ToolExecutionNotificationBuilder();
1✔
2485
        }
2486

2487
        public SarifLog.ToolExecutionNotification.ToolExecutionNotificationBuilder toBuilder() {
UNCOV
2488
            return new SarifLog.ToolExecutionNotification.ToolExecutionNotificationBuilder().locations(this.locations).message(this.message).exception(this.exception);
×
2489
        }
2490

2491
        /**
2492
         * A list of related locations to the error.
2493
         */
2494
        public List<Location> getLocations() {
UNCOV
2495
            return this.locations;
×
2496
        }
2497

2498
        /**
2499
         * A message component to detail the runtime error.
2500
         */
2501
        public Message getMessage() {
UNCOV
2502
            return this.message;
×
2503
        }
2504

2505
        /**
2506
         * A exception component to detail the tool exception.
2507
         */
2508
        public Exception getException() {
UNCOV
2509
            return this.exception;
×
2510
        }
2511

2512
        /**
2513
         * A list of related locations to the error.
2514
         *
2515
         * @return {@code this}.
2516
         */
2517
        public SarifLog.ToolExecutionNotification setLocations(final List<Location> locations) {
UNCOV
2518
            this.locations = locations;
×
2519
            return this;
×
2520
        }
2521

2522
        /**
2523
         * A message component to detail the runtime error.
2524
         *
2525
         * @return {@code this}.
2526
         */
2527
        public SarifLog.ToolExecutionNotification setMessage(final Message message) {
UNCOV
2528
            this.message = message;
×
2529
            return this;
×
2530
        }
2531

2532
        /**
2533
         * A exception component to detail the tool exception.
2534
         *
2535
         * @return {@code this}.
2536
         */
2537
        public SarifLog.ToolExecutionNotification setException(final Exception exception) {
UNCOV
2538
            this.exception = exception;
×
2539
            return this;
×
2540
        }
2541

2542
        @Override
2543
        public boolean equals(Object o) {
NEW
2544
            if (o == null || getClass() != o.getClass()) {
×
UNCOV
2545
                return false;
×
2546
            }
NEW
2547
            ToolExecutionNotification that = (ToolExecutionNotification) o;
×
NEW
2548
            return Objects.equals(locations, that.locations) && Objects.equals(message, that.message) && Objects.equals(exception, that.exception);
×
2549
        }
2550

2551
        @Override
2552
        public int hashCode() {
NEW
2553
            return Objects.hash(locations, message, exception);
×
2554
        }
2555

2556
        @Override
2557
        public String toString() {
UNCOV
2558
            return "SarifLog.ToolExecutionNotification(locations=" + this.getLocations() + ", message=" + this.getMessage() + ", exception=" + this.getException() + ")";
×
2559
        }
2560
    }
2561

2562

2563
    /**
2564
     * An invocation component to specify tool invocation details/errors.
2565
     */
2566
    public static final class Invocation {
2567
        private Boolean executionSuccessful;
2568
        private List<ToolConfigurationNotification> toolConfigurationNotifications;
2569
        private List<ToolExecutionNotification> toolExecutionNotifications;
2570

2571
        private Invocation(final Boolean executionSuccessful, final List<ToolConfigurationNotification> toolConfigurationNotifications, final List<ToolExecutionNotification> toolExecutionNotifications) {
1✔
2572
            this.executionSuccessful = executionSuccessful;
1✔
2573
            this.toolConfigurationNotifications = toolConfigurationNotifications;
1✔
2574
            this.toolExecutionNotifications = toolExecutionNotifications;
1✔
2575
        }
1✔
2576

2577
        public static final class InvocationBuilder {
2578
            private Boolean executionSuccessful;
2579
            private List<ToolConfigurationNotification> toolConfigurationNotifications;
2580
            private List<ToolExecutionNotification> toolExecutionNotifications;
2581

2582
            private InvocationBuilder() {
2583
                // make default ctor private; use factory method Invocation#builder() instead.
2584
            }
2585

2586
            /**
2587
             * An indicator of execution status.
2588
             */
2589
            public SarifLog.Invocation.InvocationBuilder executionSuccessful(final Boolean executionSuccessful) {
2590
                this.executionSuccessful = executionSuccessful;
1✔
2591
                return this;
1✔
2592
            }
2593

2594
            /**
2595
             * A list of associated tool configuration errors.
2596
             */
2597
            public SarifLog.Invocation.InvocationBuilder toolConfigurationNotifications(final List<ToolConfigurationNotification> toolConfigurationNotifications) {
2598
                this.toolConfigurationNotifications = toolConfigurationNotifications;
1✔
2599
                return this;
1✔
2600
            }
2601

2602
            /**
2603
             * A list of associated tool runtime errors.
2604
             */
2605
            public SarifLog.Invocation.InvocationBuilder toolExecutionNotifications(final List<ToolExecutionNotification> toolExecutionNotifications) {
2606
                this.toolExecutionNotifications = toolExecutionNotifications;
1✔
2607
                return this;
1✔
2608
            }
2609

2610
            public SarifLog.Invocation build() {
2611
                return new SarifLog.Invocation(this.executionSuccessful, this.toolConfigurationNotifications, this.toolExecutionNotifications);
1✔
2612
            }
2613

2614
            @Override
2615
            public String toString() {
UNCOV
2616
                return "SarifLog.Invocation.InvocationBuilder(executionSuccessful=" + this.executionSuccessful + ", toolConfigurationNotifications=" + this.toolConfigurationNotifications + ", toolExecutionNotifications=" + this.toolExecutionNotifications + ")";
×
2617
            }
2618
        }
2619

2620
        public static SarifLog.Invocation.InvocationBuilder builder() {
2621
            return new SarifLog.Invocation.InvocationBuilder();
1✔
2622
        }
2623

2624
        public SarifLog.Invocation.InvocationBuilder toBuilder() {
UNCOV
2625
            return new SarifLog.Invocation.InvocationBuilder().executionSuccessful(this.executionSuccessful).toolConfigurationNotifications(this.toolConfigurationNotifications).toolExecutionNotifications(this.toolExecutionNotifications);
×
2626
        }
2627

2628
        public Boolean getExecutionSuccessful() {
UNCOV
2629
            return this.executionSuccessful;
×
2630
        }
2631

2632
        public List<ToolConfigurationNotification> getToolConfigurationNotifications() {
UNCOV
2633
            return this.toolConfigurationNotifications;
×
2634
        }
2635

2636
        public List<ToolExecutionNotification> getToolExecutionNotifications() {
UNCOV
2637
            return this.toolExecutionNotifications;
×
2638
        }
2639

2640
        public SarifLog.Invocation setExecutionSuccessful(final Boolean executionSuccessful) {
UNCOV
2641
            this.executionSuccessful = executionSuccessful;
×
2642
            return this;
×
2643
        }
2644

2645
        public SarifLog.Invocation setToolConfigurationNotifications(final List<ToolConfigurationNotification> toolConfigurationNotifications) {
UNCOV
2646
            this.toolConfigurationNotifications = toolConfigurationNotifications;
×
2647
            return this;
×
2648
        }
2649

2650
        public SarifLog.Invocation setToolExecutionNotifications(final List<ToolExecutionNotification> toolExecutionNotifications) {
UNCOV
2651
            this.toolExecutionNotifications = toolExecutionNotifications;
×
2652
            return this;
×
2653
        }
2654

2655
        @Override
2656
        public boolean equals(Object o) {
NEW
2657
            if (o == null || getClass() != o.getClass()) {
×
UNCOV
2658
                return false;
×
2659
            }
NEW
2660
            Invocation that = (Invocation) o;
×
NEW
2661
            return Objects.equals(executionSuccessful, that.executionSuccessful) && Objects.equals(toolConfigurationNotifications, that.toolConfigurationNotifications) && Objects.equals(toolExecutionNotifications, that.toolExecutionNotifications);
×
2662
        }
2663

2664
        @Override
2665
        public int hashCode() {
NEW
2666
            return Objects.hash(executionSuccessful, toolConfigurationNotifications, toolExecutionNotifications);
×
2667
        }
2668

2669
        @Override
2670
        public String toString() {
UNCOV
2671
            return "SarifLog.Invocation(executionSuccessful=" + this.getExecutionSuccessful() + ", toolConfigurationNotifications=" + this.getToolConfigurationNotifications() + ", toolExecutionNotifications=" + this.getToolExecutionNotifications() + ")";
×
2672
        }
2673
    }
2674

2675
    private static String defaultSchema() {
2676
        return "https://json.schemastore.org/sarif-2.1.0.json";
1✔
2677
    }
2678

2679
    private static String defaultVersion() {
2680
        return "2.1.0";
1✔
2681
    }
2682

2683
    private SarifLog(final String schema, final String version, final List<Run> runs) {
1✔
2684
        this.schema = schema;
1✔
2685
        this.version = version;
1✔
2686
        this.runs = runs;
1✔
2687
    }
1✔
2688

2689

2690
    public static final class SarifLogBuilder {
2691
        private boolean schemaSet;
2692
        private String schemaValue;
2693
        private boolean versionSet;
2694
        private String versionValue;
2695
        private List<Run> runs;
2696

2697
        private SarifLogBuilder() {
2698
            // make default ctor private; use factory method SarifLog#builder() instead.
2699
        }
2700

2701
        /**
2702
         * The URI of the JSON schema corresponding to the version.
2703
         *
2704
         * @return {@code this}.
2705
         */
2706
        public SarifLog.SarifLogBuilder schema(final String schema) {
UNCOV
2707
            this.schemaValue = schema;
×
2708
            schemaSet = true;
×
2709
            return this;
×
2710
        }
2711

2712
        /**
2713
         * The SARIF format version of this log file.
2714
         *
2715
         * @return {@code this}.
2716
         */
2717
        public SarifLog.SarifLogBuilder version(final String version) {
UNCOV
2718
            this.versionValue = version;
×
2719
            versionSet = true;
×
2720
            return this;
×
2721
        }
2722

2723
        /**
2724
         * The set of runs contained in this log file.
2725
         *
2726
         * @return {@code this}.
2727
         */
2728
        public SarifLog.SarifLogBuilder runs(final List<Run> runs) {
2729
            this.runs = runs;
1✔
2730
            return this;
1✔
2731
        }
2732

2733
        public SarifLog build() {
2734
            String schemaValue = this.schemaValue;
1✔
2735
            if (!this.schemaSet) {
1!
2736
                schemaValue = SarifLog.defaultSchema();
1✔
2737
            }
2738
            String versionValue = this.versionValue;
1✔
2739
            if (!this.versionSet) {
1!
2740
                versionValue = SarifLog.defaultVersion();
1✔
2741
            }
2742
            return new SarifLog(schemaValue, versionValue, this.runs);
1✔
2743
        }
2744

2745
        @Override
2746
        public String toString() {
UNCOV
2747
            return "SarifLog.SarifLogBuilder(schema$value=" + this.schemaValue + ", version$value=" + this.versionValue + ", runs=" + this.runs + ")";
×
2748
        }
2749
    }
2750

2751
    public static SarifLog.SarifLogBuilder builder() {
2752
        return new SarifLog.SarifLogBuilder();
1✔
2753
    }
2754

2755
    /**
2756
     * The URI of the JSON schema corresponding to the version.
2757
     */
2758
    public String getSchema() {
UNCOV
2759
        return this.schema;
×
2760
    }
2761

2762
    /**
2763
     * The SARIF format version of this log file.
2764
     */
2765
    public String getVersion() {
UNCOV
2766
        return this.version;
×
2767
    }
2768

2769
    /**
2770
     * The set of runs contained in this log file.
2771
     */
2772
    public List<Run> getRuns() {
UNCOV
2773
        return this.runs;
×
2774
    }
2775

2776
    /**
2777
     * The URI of the JSON schema corresponding to the version.
2778
     *
2779
     * @return {@code this}.
2780
     */
2781
    public SarifLog setSchema(final String schema) {
UNCOV
2782
        this.schema = schema;
×
2783
        return this;
×
2784
    }
2785

2786
    /**
2787
     * The SARIF format version of this log file.
2788
     *
2789
     * @return {@code this}.
2790
     */
2791
    public SarifLog setVersion(final String version) {
UNCOV
2792
        this.version = version;
×
2793
        return this;
×
2794
    }
2795

2796
    /**
2797
     * The set of runs contained in this log file.
2798
     *
2799
     * @return {@code this}.
2800
     */
2801
    public SarifLog setRuns(final List<Run> runs) {
UNCOV
2802
        this.runs = runs;
×
2803
        return this;
×
2804
    }
2805

2806
    @Override
2807
    public boolean equals(Object o) {
NEW
2808
        if (o == null || getClass() != o.getClass()) {
×
UNCOV
2809
            return false;
×
2810
        }
NEW
2811
        SarifLog sarifLog = (SarifLog) o;
×
NEW
2812
        return Objects.equals(schema, sarifLog.schema) && Objects.equals(version, sarifLog.version) && Objects.equals(runs, sarifLog.runs);
×
2813
    }
2814

2815
    @Override
2816
    public int hashCode() {
NEW
2817
        return Objects.hash(schema, version, runs);
×
2818
    }
2819

2820
    @Override
2821
    public String toString() {
UNCOV
2822
        return "SarifLog(schema=" + this.getSchema() + ", version=" + this.getVersion() + ", runs=" + this.getRuns() + ")";
×
2823
    }
2824
}
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