Author: davsclaus
Date: Wed Dec 10 09:03:09 2008
New Revision: 725339
URL: http://svn.apache.org/viewvc?rev=725339&view=rev
Log:
CAMEL-1155: Refactored ObjectHelper to use isEmpty, isNotEmpty for null and
empty string tests.
Modified:
activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
Modified:
activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
URL:
http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java?rev=725339&r1=725338&r2=725339&view=diff
==============================================================================
---
activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
(original)
+++
activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
Wed Dec 10 09:03:09 2008
@@ -300,14 +300,28 @@
return false;
}
+ /**
+ * @deprecated will be removed in Camel 2.0 - use isNotEmpty() instead
+ */
public static boolean isNotNullAndNonEmpty(String text) {
return text != null && text.trim().length() > 0;
}
+ /**
+ * @deprecated will be removed in Camel 2.0 - use isEmpty() instead
+ */
public static boolean isNullOrBlank(String text) {
return text == null || text.trim().length() <= 0;
}
+ public static boolean isEmpty(String text) {
+ return isNullOrBlank(text);
+ }
+
+ public static boolean isNotEmpty(String text) {
+ return isNotNullAndNonEmpty(text);
+ }
+
/**
* A helper method to access a system property, catching any security
* exceptions