|
From: <pat...@us...> - 2010-02-11 21:07:25
|
Revision: 1035
http://cishell.svn.sourceforge.net/cishell/?rev=1035&view=rev
Author: pataphil
Date: 2010-02-11 21:07:18 +0000 (Thu, 11 Feb 2010)
Log Message:
-----------
* Added StringUtilities.alternativeIfNotNull_Empty_OrWhitespace_IgnoreCase().
Modified Paths:
--------------
trunk/core/org.cishell.utilities/src/org/cishell/utilities/StringUtilities.java
Modified: trunk/core/org.cishell.utilities/src/org/cishell/utilities/StringUtilities.java
===================================================================
--- trunk/core/org.cishell.utilities/src/org/cishell/utilities/StringUtilities.java 2010-02-11 16:56:06 UTC (rev 1034)
+++ trunk/core/org.cishell.utilities/src/org/cishell/utilities/StringUtilities.java 2010-02-11 21:07:18 UTC (rev 1035)
@@ -281,4 +281,22 @@
return string1;
}
+
+ public static Object alternativeIfNotNull_Empty_OrWhitespace(
+ String string, Object alternative) {
+ if (!isNull_Empty_OrWhitespace(string)) {
+ return string;
+ } else {
+ return alternative;
+ }
+ }
+
+ public static Object alternativeIfNotNull_Empty_OrWhitespace_IgnoreCase(
+ String string, Object alternative) {
+ if (!isNull_Empty_OrWhitespace(string)) {
+ return string.toLowerCase();
+ } else {
+ return alternative;
+ }
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|