]> git.mxchange.org Git - jcore-utils.git/blobdiff - src/org/mxchange/jcoreee/utils/FacesUtils.java
Continued:
[jcore-utils.git] / src / org / mxchange / jcoreee / utils / FacesUtils.java
index 674b8f1bd1752619d63288876be96247ccbf6e7a..35e0b28e42fcbe294824bb5adbe828b08138d3a6 100644 (file)
  */
 package org.mxchange.jcoreee.utils;
 
+import java.io.Serializable;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
 
 /**
- * An utilities class for JSF
+ * An utilities class for JavaEE applications, entities and EJBs and more
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public class FacesUtils {
+public class FacesUtils implements Serializable {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 19_863_546_716_250L;
 
        /**
         * Generates a "base URL" for for example mail templates. For JSF
@@ -78,66 +84,6 @@ public class FacesUtils {
                return baseUrl;
        }
 
-       /**
-        * Compares both string with null-safety. This method is based on the
-        * example from
-        * https://codereview.stackexchange.com/questions/20191/comparing-two-strings-which-could-be-null-or-blank-in-a-comparator
-        * <p>
-        * @param str0 First string
-        * @param str1 Second string
-        * <p>
-        * @return Comparison value, 0 means equals, -1 means str0 smaller str2 and
-        *         2 means str0 bigger str2
-        */
-       @SuppressWarnings ("null")
-       public static int comareTo (final String str0, final String str1) {
-               // Check both strings for null and empty
-               boolean isStr0Empty = (str0 == null || str0.isEmpty());
-               boolean isStr1Empty = (str1 == null || str1.isEmpty());
-
-               // Check conditions
-               if (isStr0Empty && isStr1Empty) {
-                       return 0;
-               } else if (isStr0Empty) {
-                       return -1;
-               } else if (isStr1Empty) {
-                       return 1;
-               }
-
-               // Compare both
-               return str0.compareTo(str1);
-       }
-
-       /**
-        * Compares both string with null-safety, ignoring case-sensitivity. This
-        * method is based on the example from
-        * https://codereview.stackexchange.com/questions/20191/comparing-two-strings-which-could-be-null-or-blank-in-a-comparator
-        * <p>
-        * @param str0 First string
-        * @param str1 Second string
-        * <p>
-        * @return Comparison value, 0 means equals, -1 means str0 smaller str2 and
-        *         2 means str0 bigger str2
-        */
-       @SuppressWarnings ("null")
-       public static int comareToIgnoreCase (final String str0, final String str1) {
-               // Check both strings for null and empty
-               boolean isStr0Empty = (str0 == null || str0.isEmpty());
-               boolean isStr1Empty = (str1 == null || str1.isEmpty());
-
-               // Check conditions
-               if (isStr0Empty && isStr1Empty) {
-                       return 0;
-               } else if (isStr0Empty) {
-                       return -1;
-               } else if (isStr1Empty) {
-                       return 1;
-               }
-
-               // Compare both
-               return str0.compareToIgnoreCase(str1);
-       }
-
        /**
         * No instances from this class are required
         */