Move Jsr305State to util.runtime

This commit is contained in:
e5l
2017-08-07 16:46:30 +03:00
parent 5fd8f93b0e
commit 746de612ad
8 changed files with 45 additions and 20 deletions
@@ -16,6 +16,7 @@
package org.jetbrains.kotlin.config
import org.jetbrains.kotlin.utils.Jsr305State
import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KProperty
@@ -54,21 +55,3 @@ class AnalysisFlag<out T> internal constructor(
val loadJsr305Annotations by Flag.Jsr305StateIgnoreByDefault
}
}
enum class Jsr305State(
val description: String,
val shouldReportWarning: Boolean = false,
val shouldReportError: Boolean = false
) {
IGNORE("ignore"),
WARN("warn", shouldReportWarning = true),
ENABLE("enable", shouldReportError = true),
;
companion object {
@JvmField
val DEFAULT: Jsr305State = IGNORE
fun findByDescription(description: String?) = values().firstOrNull { it.description == description }
}
}