diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanSeverity.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanSeverity.java index fb85718b2c4..6f340dc8493 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanSeverity.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanSeverity.java @@ -56,4 +56,19 @@ public enum CodanSeverity { } return svalues; } + + /** + * @param intValue + * @return value of severity by its integer value + * @since 1.1 + */ + public static CodanSeverity valueOf(int intValue) { + if (intValue == IMarker.SEVERITY_INFO) + return Info; + if (intValue == IMarker.SEVERITY_WARNING) + return Warning; + if (intValue == IMarker.SEVERITY_ERROR) + return Error; + return null; + } }