48
49 /** Were there any errors found? */
50 public boolean errorsFound() {
51 return foundErrors;
52 }
53
54 /** Get all diagnostic keys */
55 public List<String> keys() {
56 return diags.stream()
57 .map(Diagnostic::getCode)
58 .collect(toList());
59 }
60
61 /** Do the diagnostics contain the specified error key? */
62 public boolean containsErrorKey(String key) {
63 return diags.stream()
64 .filter(d -> d.getKind() == Diagnostic.Kind.ERROR)
65 .anyMatch(d -> d.getCode().equals(key));
66 }
67
68 /** Get the error keys */
69 public List<String> errorKeys() {
70 return diags.stream()
71 .filter(d -> d.getKind() == Diagnostic.Kind.ERROR)
72 .map(Diagnostic::getCode)
73 .collect(toList());
74 }
75
76 public String toString() { return keys().toString(); }
77
78 /** Clear all diagnostic state */
79 public void reset() {
80 diags.clear();
81 foundErrors = false;
82 }
83 }
|
48
49 /** Were there any errors found? */
50 public boolean errorsFound() {
51 return foundErrors;
52 }
53
54 /** Get all diagnostic keys */
55 public List<String> keys() {
56 return diags.stream()
57 .map(Diagnostic::getCode)
58 .collect(toList());
59 }
60
61 /** Do the diagnostics contain the specified error key? */
62 public boolean containsErrorKey(String key) {
63 return diags.stream()
64 .filter(d -> d.getKind() == Diagnostic.Kind.ERROR)
65 .anyMatch(d -> d.getCode().equals(key));
66 }
67
68 /** Do the diagnostics contain the specified warning key? */
69 public boolean containsWarningKey(String key) {
70 return diags.stream()
71 .filter(d -> d.getKind() == Diagnostic.Kind.WARNING)
72 .anyMatch(d -> d.getCode().equals(key));
73 }
74
75 /** Get the error keys */
76 public List<String> errorKeys() {
77 return diags.stream()
78 .filter(d -> d.getKind() == Diagnostic.Kind.ERROR)
79 .map(Diagnostic::getCode)
80 .collect(toList());
81 }
82
83 public String toString() { return keys().toString(); }
84
85 /** Clear all diagnostic state */
86 public void reset() {
87 diags.clear();
88 foundErrors = false;
89 }
90 }
|