diff options
author | Jens Jansson <peppe@vaadin.com> | 2011-12-01 16:57:56 +0200 |
---|---|---|
committer | Jens Jansson <peppe@vaadin.com> | 2011-12-01 16:57:56 +0200 |
commit | 7634b797a7e3105c72238e5ad5a4668d2981ffb9 (patch) | |
tree | 12363140fe0a9ada686b93b8de5007d7c560043b | |
parent | 24b8dade26ba23bce6751453f47e04c01795c5bf (diff) | |
download | vaadin-framework-7634b797a7e3105c72238e5ad5a4668d2981ffb9.tar.gz vaadin-framework-7634b797a7e3105c72238e5ad5a4668d2981ffb9.zip |
#8019 Add a intValue-method to ErrorMessage.ErrorLevel enum which should be used rather than the ordinal so that enum order doesn't matter. Switching use of ordinal to intValue coming up in next commit.
-rw-r--r-- | src/com/vaadin/terminal/ErrorMessage.java | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/com/vaadin/terminal/ErrorMessage.java b/src/com/vaadin/terminal/ErrorMessage.java index 123d12d068..d93ba62478 100644 --- a/src/com/vaadin/terminal/ErrorMessage.java +++ b/src/com/vaadin/terminal/ErrorMessage.java @@ -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; |