]> git.ktnx.net Git - mobile-ledger.git/commitdiff
variant of isEmptyOrNull for CharSequence
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 1 May 2020 14:48:56 +0000 (17:48 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 1 May 2020 14:48:56 +0000 (17:48 +0300)
app/src/main/java/net/ktnx/mobileledger/utils/Misc.java

index caa107c272723da26d4d766ea6b0d5cb63dc2a55..c4dc78750b97d3951c3876c9b901b8b8375151f4 100644 (file)
@@ -72,4 +72,9 @@ public class Misc {
     public static boolean equalStrings(String a, String b) {
         return nullIsEmpty(a).equals(nullIsEmpty(b));
     }
+    public static boolean isEmptyOrNull(CharSequence text) {
+        if (text == null)
+            return true;
+        return text.length() == 0;
+    }
 }