You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2024/06/26 13:57:08 UTC

(myfaces) branch main updated: Faces Spec #1592 - add SEVERITY_SUCCESS

This is an automated email from the ASF dual-hosted git repository.

tandraschko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/main by this push:
     new 3b6901392 Faces Spec #1592 - add SEVERITY_SUCCESS
3b6901392 is described below

commit 3b690139243194e48a0557d9dd0a21f0d5b7af01
Author: tandraschko <ta...@apache.org>
AuthorDate: Wed Jun 26 15:55:22 2024 +0200

    Faces Spec #1592 - add SEVERITY_SUCCESS
---
 .../main/java/jakarta/faces/application/FacesMessage.java    | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/api/src/main/java/jakarta/faces/application/FacesMessage.java b/api/src/main/java/jakarta/faces/application/FacesMessage.java
index 6c72b80e7..3f6ab68dc 100755
--- a/api/src/main/java/jakarta/faces/application/FacesMessage.java
+++ b/api/src/main/java/jakarta/faces/application/FacesMessage.java
@@ -72,20 +72,25 @@ public class FacesMessage implements Serializable
      */
     public static final FacesMessage.Severity SEVERITY_INFO = new Severity("INFO", 0);
 
+    /**
+     * Message severity level indicating an success message rather than an error.
+     */
+    public static final FacesMessage.Severity SEVERITY_SUCCESS = new Severity("SUCCESS", 1);
+
     /**
      * Message severity level indicating that an error might have occurred.
      */
-    public static final FacesMessage.Severity SEVERITY_WARN = new Severity("WARN", 1);
+    public static final FacesMessage.Severity SEVERITY_WARN = new Severity("WARN", 2);
 
     /**
      * Message severity level indicating that an error has occurred.
      */
-    public static final FacesMessage.Severity SEVERITY_ERROR = new Severity("ERROR", 2);
+    public static final FacesMessage.Severity SEVERITY_ERROR = new Severity("ERROR", 3);
 
     /**
      * Message severity level indicating that a serious error has occurred.
      */
-    public static final FacesMessage.Severity SEVERITY_FATAL = new Severity("FATAL", 3);
+    public static final FacesMessage.Severity SEVERITY_FATAL = new Severity("FATAL", 4);
 
     /**
      * Immutable <code>Lis</code> of valid {@link FacesMessage.Severity}instances, in ascending order of their ordinal
@@ -102,6 +107,7 @@ public class FacesMessage implements Serializable
     {
         Map<String, FacesMessage.Severity> map = new HashMap<>(7);
         map.put(SEVERITY_INFO.toString(), SEVERITY_INFO);
+        map.put(SEVERITY_SUCCESS.toString(), SEVERITY_SUCCESS);
         map.put(SEVERITY_WARN.toString(), SEVERITY_WARN);
         map.put(SEVERITY_ERROR.toString(), SEVERITY_ERROR);
         map.put(SEVERITY_FATAL.toString(), SEVERITY_FATAL);