use of org.apache.commons.text.TextStringBuilder in project gobblin by apache.
the class AutomaticTroubleshooterImpl method getIssueSummaryMessage.
@Override
public String getIssueSummaryMessage() throws TroubleshooterException {
List<Issue> issues = issueRepository.getAll();
TextStringBuilder sb = new TextStringBuilder();
sb.appendln("");
sb.appendln("vvvvv============= Issues (summary) =============vvvvv");
for (int i = 0; i < issues.size(); i++) {
Issue issue = issues.get(i);
sb.appendln("%s) %s %s %s | source: %s", i + 1, issue.getSeverity().toString(), issue.getCode(), issue.getSummary(), issue.getSourceClass());
}
sb.append("^^^^^=============================================^^^^^");
return sb.toString();
}
use of org.apache.commons.text.TextStringBuilder in project gobblin by apache.
the class AutomaticTroubleshooterImpl method getIssueDetailsMessage.
@Override
public String getIssueDetailsMessage() throws TroubleshooterException {
List<Issue> issues = issueRepository.getAll();
TextStringBuilder sb = new TextStringBuilder();
sb.appendln("");
sb.appendln("vvvvv============= Issues (detailed) =============vvvvv");
for (int i = 0; i < issues.size(); i++) {
Issue issue = issues.get(i);
sb.appendln("%s) %s %s %s", i + 1, issue.getSeverity().toString(), issue.getCode(), issue.getSummary());
sb.appendln("\tsource: %s", issue.getSourceClass());
if (issue.getDetails() != null) {
sb.appendln("\t" + issue.getDetails().replaceAll(System.lineSeparator(), System.lineSeparator() + "\t"));
}
if (issue.getProperties() != null) {
issue.getProperties().forEach((key, value) -> {
sb.appendln("\t%s: %s", key, value);
});
}
}
sb.append("^^^^^================================================^^^^^");
return sb.toString();
}
Aggregations