1 package org.simantics.issues.common;
3 import org.simantics.db.Resource;
4 import org.simantics.issues.Severity;
7 public class SimpleIssue {
8 public static final SimpleIssue[] EMPTY_ARRAY = new SimpleIssue[0];
10 public final String label;
11 public final Severity severity;
12 // Optional, not used for equals/hashCode
13 public final Resource issueResource;
15 public SimpleIssue(String label, Severity severity) {
16 this(label, severity, null);
19 public SimpleIssue(String label, Severity severity, Resource issueResource) {
21 throw new NullPointerException();
23 throw new NullPointerException();
25 this.severity = severity;
26 this.issueResource = issueResource;
30 public int hashCode() {
31 return 31*label.hashCode() + severity.hashCode();
35 public boolean equals(Object obj) {
40 if (getClass() != obj.getClass())
42 SimpleIssue other = (SimpleIssue) obj;
43 return severity.equals(other.severity) && label.equals(other.label);