From 20255f36e19b135d15897c89587c69fbff492c29 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 7 Aug 2015 14:07:54 +0200 Subject: [PATCH] =?utf8?q?Added=20convertNullToEmpty()=20Signed-off-by:Rol?= =?utf8?q?and=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../mxchange/jcore/BaseFrameworkSystem.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/org/mxchange/jcore/BaseFrameworkSystem.java b/src/org/mxchange/jcore/BaseFrameworkSystem.java index 7d96be8..8664591 100644 --- a/src/org/mxchange/jcore/BaseFrameworkSystem.java +++ b/src/org/mxchange/jcore/BaseFrameworkSystem.java @@ -800,4 +800,27 @@ public class BaseFrameworkSystem implements FrameworkInterface { // Return list iterator return map.entrySet().iterator(); } + + /** + * Converts null to empty string or leaves original string. + * + * @param str Any string + * @return Empty string if null or original string + */ + protected String convertNullToEmpty (final String str) { + // Trace message + this.getLogger().trace(MessageFormat.format("str={0}", str)); + + // Is it null? + if (str == null) { + // Return empty string + return ""; + } + + // Trace message + this.getLogger().trace(MessageFormat.format("str={0} - EXIT!", str)); + + // Return it + return str; + } } -- 2.39.5