Add integer value to compiler message severity
This commit is contained in:
+24
-6
@@ -19,12 +19,30 @@ package org.jetbrains.kotlin.cli.common.messages;
|
|||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
public enum CompilerMessageSeverity {
|
public enum CompilerMessageSeverity {
|
||||||
INFO,
|
ERROR(0),
|
||||||
ERROR,
|
EXCEPTION(5),
|
||||||
WARNING,
|
WARNING(10),
|
||||||
EXCEPTION,
|
INFO(15),
|
||||||
LOGGING,
|
OUTPUT(20),
|
||||||
OUTPUT;
|
LOGGING(25);
|
||||||
|
|
||||||
|
private final int value;
|
||||||
|
|
||||||
|
CompilerMessageSeverity(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
static CompilerMessageSeverity fromValue(int value) {
|
||||||
|
for (CompilerMessageSeverity severity : CompilerMessageSeverity.values()) {
|
||||||
|
if (severity.value == value) return severity;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public static final EnumSet<CompilerMessageSeverity> ERRORS = EnumSet.of(ERROR, EXCEPTION);
|
public static final EnumSet<CompilerMessageSeverity> ERRORS = EnumSet.of(ERROR, EXCEPTION);
|
||||||
public static final EnumSet<CompilerMessageSeverity> VERBOSE = EnumSet.of(OUTPUT, LOGGING);
|
public static final EnumSet<CompilerMessageSeverity> VERBOSE = EnumSet.of(OUTPUT, LOGGING);
|
||||||
|
|||||||
Reference in New Issue
Block a user