Skip to content

Commit

Permalink
Support adding report instances
Browse files Browse the repository at this point in the history
  • Loading branch information
ChAoSUnItY committed Jun 15, 2022
1 parent 1c17125 commit 4d2b960
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/chaos/unity/nenggao/FileReportBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,29 @@ private FileReportBuilder(@NotNull String source) {
return new FileReportBuilder(source);
}

public @NotNull FileReportBuilder report(@NotNull Report report) {
this.reports.add(report);
return this;
}

public @NotNull ReportBuilder warning(@NotNull Span span, @NotNull String message, @Nullable Object... args) {
return new ReportBuilder(this, new Warning(span, String.format(message, args)));
}

public @NotNull FileReportBuilder warning(@NotNull Warning warning) {
this.reports.add(warning);
return this;
}

public @NotNull ReportBuilder error(@NotNull Span span, @NotNull String message, @Nullable Object... args) {
return new ReportBuilder(this, new Error(span, String.format(message, args)));
}

public @NotNull FileReportBuilder error(@NotNull Error error) {
this.reports.add(error);
return this;
}

public @NotNull FileReportBuilder sourceName(@NotNull String sourceName) {
this.sourceName = sourceName;
return this;
Expand Down

0 comments on commit 4d2b960

Please sign in to comment.