changeset 2344:ec0ffc842573

Extracted StringUtil.wWrap method from WaterlevelSelectState . flys-backend/trunk@2858 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 28 Sep 2011 15:35:54 +0000 (2011-09-28)
parents 6662b0ea20c1
children c3ea91aee989
files flys-backend/ChangeLog flys-backend/src/main/java/de/intevation/flys/utils/StringUtil.java
diffstat 2 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/ChangeLog	Wed Sep 28 08:17:16 2011 +0000
+++ b/flys-backend/ChangeLog	Wed Sep 28 15:35:54 2011 +0000
@@ -1,3 +1,8 @@
+2011-09-28  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/utils/StringUtil.java:
+	  (wWrap): New method (extracted from WaterlevelSelectState).
+
 2011-09-28  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
 	* src/main/java/de/intevation/flys/utils/StringUtil.java:
--- a/flys-backend/src/main/java/de/intevation/flys/utils/StringUtil.java	Wed Sep 28 08:17:16 2011 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/utils/StringUtil.java	Wed Sep 28 15:35:54 2011 +0000
@@ -98,6 +98,18 @@
     }
 
 
+    /**
+     * From "Q=1" make "W(Q=1)".
+     * @return original string wraped in "W()" if it contains a "Q", original
+     *         string otherwise.
+     */
+    public static String wWrap(String wOrQ) {
+        return (wOrQ != null && wOrQ.indexOf("Q") >=0)
+               ? "W(" + wOrQ + ")"
+               : wOrQ;
+        }
+
+
     public static final String [] splitLines(String s) {
         if (s == null) {
             return null;

http://dive4elements.wald.intevation.org