]> git.ktnx.net Git - mobile-ledger.git/commitdiff
utility routines for comparing strings with another string/CharSeqence, treating...
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 20 Apr 2020 18:36:24 +0000 (21:36 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 20 Apr 2020 18:36:24 +0000 (21:36 +0300)
app/src/main/java/net/ktnx/mobileledger/utils/Misc.java

index 4443f2303dfe3eff7aee5e779cd2bcbfd8c03589..caa107c272723da26d4d766ea6b0d5cb63dc2a55 100644 (file)
@@ -66,4 +66,10 @@ public class Misc {
         if (str == null) return true;
         return str.isEmpty();
     }
+    public static boolean equalStrings(String u, CharSequence text) {
+        return nullIsEmpty(u).equals(text.toString());
+    }
+    public static boolean equalStrings(String a, String b) {
+        return nullIsEmpty(a).equals(nullIsEmpty(b));
+    }
 }