User: user57
Date: 02/02/16 22:01:08
Modified: src/main/org/jboss/util Strings.java
Log:
o added copmare method used by JMSRA
Revision Changes Path
1.2 +20 -0 jboss-common/src/main/org/jboss/util/Strings.java
Index: Strings.java
===================================================================
RCS file: /cvsroot/jboss/jboss-common/src/main/org/jboss/util/Strings.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Strings.java 15 Feb 2002 06:14:18 -0000 1.1
+++ Strings.java 17 Feb 2002 06:01:08 -0000 1.2
@@ -14,7 +14,7 @@
/**
* A collection of String utilities.
*
- * @version <tt>$Revision: 1.1 $</tt>
+ * @version <tt>$Revision: 1.2 $</tt>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
*/
public final class Strings
@@ -534,6 +534,26 @@
// Misc Methods //
/////////////////////////////////////////////////////////////////////////
+ /**
+ * <p>Compare two strings.
+ *
+ * <p>Both or one of them may be null.
+ *
+ * @return true if object equals or intern ==, else false.
+ */
+ public static boolean compare(final String me, final String you) {
+ // If both null or intern equals
+ if (me == you)
+ return true;
+
+ // if me null and you are not
+ if (me == null && you != null)
+ return false;
+
+ // me will not be null, test for equality
+ return me.equals(you);
+ }
+
/**
* Check if the given string is empty.
*
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development