diff --git a/settings.gradle b/settings.gradle index 7469728..b32cb39 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1 @@ -rootProject.name = 'sample-module-gradle' - +rootProject.name = 'sample-module-gradle' \ No newline at end of file diff --git a/src/main/java/com/cubetiqs/util/StringHelper.java b/src/main/java/com/cubetiqs/util/StringHelper.java new file mode 100644 index 0000000..f6e7ab1 --- /dev/null +++ b/src/main/java/com/cubetiqs/util/StringHelper.java @@ -0,0 +1,20 @@ +package com.cubetiqs.util; + +/** + * String util helper + * + * @author sombochea + * @since 1.0 + */ +public final class StringHelper { + public static String getOrDefault(String text, String fallback) { + if (text == null || text.isEmpty()) { + return fallback; + } + return text; + } + + public static String getOrEmpty(String text) { + return getOrDefault(text, ""); + } +}