se.bjurr.violations.comments.lib.model.ViolationData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of violation-comments-lib Show documentation
Show all versions of violation-comments-lib Show documentation
Library that adds violation comments from static code analysis to pull requests.
The newest version!
package se.bjurr.violations.comments.lib.model;
import static se.bjurr.violations.lib.util.StringUtils.escapeHTML;
import se.bjurr.violations.lib.model.Violation;
public class ViolationData extends Violation {
private static final long serialVersionUID = 5123064911100468010L;
private final String messageEscaped;
private final String fileName;
public ViolationData(final Violation violation) {
super(violation);
messageEscaped = escapeHTML(violation.getMessage());
final String[] fileParts = violation.getFile().split("\\/");
fileName = fileParts[fileParts.length - 1];
}
public String getFileName() {
return fileName;
}
public String getMessageEscaped() {
return messageEscaped;
}
}