[Schmitzm-commits] r1768 - trunk/schmitzm-core/src/main/java/de/schmitzm/lang

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Oct 30 01:22:04 CEST 2011


Author: alfonx
Date: 2011-10-30 01:22:03 +0200 (Sun, 30 Oct 2011)
New Revision: 1768

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/lang/LangUtil.java
Log:
Dynamischere Methodeanparameter:

	public static Boolean parseString(String str, Boolean defaultValue) {
		if (defaultValue == null) {
			return parseStringDefaultNull(str);
		} else if (defaultValue == true) {
			return parseStringDefaultTrue(str);
		} else {
			return parseStringDefaultFalse(str);
		}
	}

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/lang/LangUtil.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/lang/LangUtil.java	2011-10-29 15:21:33 UTC (rev 1767)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/lang/LangUtil.java	2011-10-29 23:22:03 UTC (rev 1768)
@@ -215,8 +215,7 @@
 	 * @param date
 	 *            date the date information is taken from
 	 * @param time
-	 *            date the time information is taken from (if {@code null} the time 00:00:00.000
-	 *            is set)
+	 *            date the time information is taken from (if {@code null} the time 00:00:00.000 is set)
 	 */
 	public static Date combineDate(Date date, Date time) {
 		Calendar dateCal = GregorianCalendar.getInstance();
@@ -1868,6 +1867,16 @@
 		return b != null ? b : true;
 	}
 
+	public static Boolean parseString(String str, Boolean defaultValue) {
+		if (defaultValue == null) {
+			return parseStringDefaultNull(str);
+		} else if (defaultValue == true) {
+			return parseStringDefaultTrue(str);
+		} else {
+			return parseStringDefaultFalse(str);
+		}
+	}
+
 	/**
 	 * Interpretiert einen {@link String} zu einem {@link boolean} mit default <code>null</code>.
 	 */



More information about the Schmitzm-commits mailing list