]> git.ktnx.net Git - mobile-ledger.git/commitdiff
more toString() support
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 30 Jan 2021 21:07:23 +0000 (21:07 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 30 Jan 2021 21:07:23 +0000 (21:07 +0000)
app/src/main/java/net/ktnx/mobileledger/model/PatternDetailsItem.java

index 935280519791bb1f2d3be4996f41180ab690e53c..a5ec165c3e18353ee7977b3a590d1c45d67c05fc 100644 (file)
@@ -237,6 +237,16 @@ abstract public class PatternDetailsItem {
         public void switchToLiteral() {
             literalValue = true;
         }
+        public String toString() {
+            if (literalValue)
+                if (value == null)
+                    return "<null>";
+                else
+                    return value.toString();
+            if (matchGroup > 0)
+                return "grp:" + matchGroup;
+            return "<null>";
+        }
     }
 
     public static class TYPE {
@@ -413,7 +423,8 @@ abstract public class PatternDetailsItem {
         @Override
         public String toString() {
             return super.toString() +
-                   String.format(" name[%s] pat[%s] test[%s]", name, pattern, testText);
+                   String.format(" name[%s] pat[%s] test[%s] tran[%s] com[%s]", name, pattern,
+                           testText, transactionDescription, transactionComment);
         }
         public String getTestText() {
             return testText;