]> source.dussan.org Git - vaadin-framework.git/commitdiff
#8019 Add a intValue-method to ErrorMessage.ErrorLevel enum which should be used...
authorJens Jansson <peppe@vaadin.com>
Thu, 1 Dec 2011 14:57:56 +0000 (16:57 +0200)
committerJens Jansson <peppe@vaadin.com>
Thu, 1 Dec 2011 14:57:56 +0000 (16:57 +0200)
src/com/vaadin/terminal/ErrorMessage.java

index 123d12d068547632483d1c48ef24ac36520bbf49..d93ba62478901653b3438b72864ad1034b76c419 100644 (file)
@@ -21,34 +21,50 @@ public interface ErrorMessage extends Paintable, Serializable {
         /**
          * Error code for informational messages.
          */
-        INFORMATION("info"),
+        INFORMATION("info", 0),
         /**
          * Error code for warning messages.
          */
-        WARNING("warning"),
+        WARNING("warning", 1),
         /**
          * Error code for regular error messages.
          */
-        ERROR("error"),
+        ERROR("error", 2),
         /**
          * Error code for critical error messages.
          */
-        CRITICAL("critical"),
+        CRITICAL("critical", 3),
         /**
          * Error code for system errors and bugs.
          */
-        SYSTEMERROR("system");
+        SYSTEMERROR("system", 4);
 
         String text;
+        int errorLevel;
 
-        private ErrorLevel(String text) {
+        private ErrorLevel(String text, int errorLevel) {
             this.text = text;
+            this.errorLevel = errorLevel;
         }
 
+        /**
+         * Textual representation for server-client communication of level
+         * 
+         * @return String for error severity
+         */
         public String getText() {
             return text;
         }
 
+        /**
+         * Integer representation of error severity for comparison
+         * 
+         * @return integer for error severity
+         */
+        public int intValue() {
+            return errorLevel;
+        }
+
         @Override
         public String toString() {
             return text;